diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-10-11 15:45:50 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-10-11 15:45:50 +0200 |
commit | 73d8609565b808ac73df5ac34e6d4f7f23c25ad6 (patch) | |
tree | 8b13c61bcd55380b36338473a74e172b63fb16d7 /src/to_html.rs | |
parent | 070b3efeeebf34fbc435ffc7fea2bad95689664a (diff) | |
download | markdown-rs-73d8609565b808ac73df5ac34e6d4f7f23c25ad6.tar.gz markdown-rs-73d8609565b808ac73df5ac34e6d4f7f23c25ad6.tar.bz2 markdown-rs-73d8609565b808ac73df5ac34e6d4f7f23c25ad6.zip |
Refactor to use a bunch of `into`
Diffstat (limited to '')
-rw-r--r-- | src/to_html.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/to_html.rs b/src/to_html.rs index a0ab152..a851580 100644 --- a/src/to_html.rs +++ b/src/to_html.rs @@ -300,7 +300,7 @@ pub fn compile(events: &[Event], bytes: &[u8], options: &CompileOptions) -> Stri .buffers .get(0) .expect("expected 1 final buffer") - .to_string() + .into() } /// Handle the event at `index`. @@ -690,7 +690,7 @@ fn on_enter_paragraph(context: &mut CompileContext) { /// Handle [`Enter`][Kind::Enter]:[`Resource`][Name::Resource]. fn on_enter_resource(context: &mut CompileContext) { context.buffer(); // We can have line endings in the resource, ignore them. - context.media_stack.last_mut().unwrap().destination = Some("".to_string()); + context.media_stack.last_mut().unwrap().destination = Some("".into()); } /// Handle [`Enter`][Kind::Enter]:[`ResourceDestinationString`][Name::ResourceDestinationString]. @@ -1733,7 +1733,7 @@ fn generate_autolink( let url = if let Some(protocol) = protocol { format!("{}{}", protocol, value) } else { - value.to_string() + value.into() }; let url = if context.options.allow_dangerous_protocol { |