aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/sanitize_uri.rs
diff options
context:
space:
mode:
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();
}
}