aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/sanitize_uri.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/sanitize_uri.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/sanitize_uri.rs')
-rw-r--r--src/util/sanitize_uri.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/util/sanitize_uri.rs b/src/util/sanitize_uri.rs
index 7006ace..cd0600d 100644
--- a/src/util/sanitize_uri.rs
+++ b/src/util/sanitize_uri.rs
@@ -1,11 +1,7 @@
//! Make urls safe.
use crate::util::encode::encode;
-use alloc::{
- format,
- string::{String, ToString},
- vec::Vec,
-};
+use alloc::{format, string::String, vec::Vec};
/// Make a value safe for injection as a URL.
///
@@ -75,7 +71,7 @@ pub fn sanitize_with_protocols(value: &str, protocols: &[&str]) -> String {
// If it is a protocol, it should be allowed.
let protocol = value[0..colon].to_lowercase();
if !protocols.contains(&protocol.as_str()) {
- return "".to_string();
+ return "".into();
}
}