aboutsummaryrefslogtreecommitdiffstats
path: root/src/to_mdast.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 15:45:50 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 15:45:50 +0200
commit73d8609565b808ac73df5ac34e6d4f7f23c25ad6 (patch)
tree8b13c61bcd55380b36338473a74e172b63fb16d7 /src/to_mdast.rs
parent070b3efeeebf34fbc435ffc7fea2bad95689664a (diff)
downloadmarkdown-rs-73d8609565b808ac73df5ac34e6d4f7f23c25ad6.tar.gz
markdown-rs-73d8609565b808ac73df5ac34e6d4f7f23c25ad6.tar.bz2
markdown-rs-73d8609565b808ac73df5ac34e6d4f7f23c25ad6.zip
Refactor to use a bunch of `into`
Diffstat (limited to 'src/to_mdast.rs')
-rw-r--r--src/to_mdast.rs6
1 files changed, 3 insertions, 3 deletions
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()
}
));
}