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/util/sanitize_uri.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/util/sanitize_uri.rs') 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(); } } -- cgit