From 73d8609565b808ac73df5ac34e6d4f7f23c25ad6 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 11 Oct 2022 15:45:50 +0200 Subject: Refactor to use a bunch of `into` --- src/to_html.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/to_html.rs') 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 { -- cgit