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_mdast.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/to_mdast.rs') diff --git a/src/to_mdast.rs b/src/to_mdast.rs index c4650da..fe5bd82 100644 --- a/src/to_mdast.rs +++ b/src/to_mdast.rs @@ -1068,7 +1068,7 @@ fn on_exit_raw_text(context: &mut CompileContext) -> Result<(), String> { } if replace { - value = str::from_utf8(&bytes).unwrap().to_string(); + value = str::from_utf8(&bytes).unwrap().into(); } } @@ -1730,7 +1730,7 @@ fn trim_eol(value: String, at_start: bool, at_end: bool) -> String { } if start > 0 || end < bytes.len() { - str::from_utf8(&bytes[start..end]).unwrap().to_string() + str::from_utf8(&bytes[start..end]).unwrap().into() } else { value } @@ -1762,7 +1762,7 @@ fn on_mismatch_error( if let Some(left) = left { format!(" before the end of `{:?}`", left.name) } else { - "".to_string() + "".into() } )); } -- cgit