aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/character_reference.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/util/character_reference.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/util/character_reference.rs')
-rw-r--r--src/util/character_reference.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/character_reference.rs b/src/util/character_reference.rs
index ee2a65c..330293c 100644
--- a/src/util/character_reference.rs
+++ b/src/util/character_reference.rs
@@ -4,7 +4,7 @@ use crate::util::constant::{
CHARACTER_REFERENCES, CHARACTER_REFERENCES_HTML_4, CHARACTER_REFERENCE_DECIMAL_SIZE_MAX,
CHARACTER_REFERENCE_HEXADECIMAL_SIZE_MAX, CHARACTER_REFERENCE_NAMED_SIZE_MAX,
};
-use alloc::string::{String, ToString};
+use alloc::string::String;
use core::str;
/// Decode named character references.
@@ -89,11 +89,11 @@ pub fn decode_numeric(value: &str, radix: u32) -> String {
// Lone surrogates, noncharacters, and out of range are handled by
// Rust.
) {
- return char.to_string();
+ return char.into();
}
}
- char::REPLACEMENT_CHARACTER.to_string()
+ char::REPLACEMENT_CHARACTER.into()
}
/// Decode a character reference.