From 540ecd19a33caee501418c4d30d07f0d88c5c0c8 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Thu, 26 Sep 2024 15:38:15 -0700 Subject: [PATCH] fix clippy lints --- percent_encoding/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/percent_encoding/src/lib.rs b/percent_encoding/src/lib.rs index c22e4ab3..0843c288 100644 --- a/percent_encoding/src/lib.rs +++ b/percent_encoding/src/lib.rs @@ -114,7 +114,7 @@ pub fn percent_encode_byte(byte: u8) -> &'static str { /// assert_eq!(percent_encode(b"foo bar?", NON_ALPHANUMERIC).to_string(), "foo%20bar%3F"); /// ``` #[inline] -pub fn percent_encode<'a, T: Into>(input: &'a [u8], ascii_set: T) -> PercentEncode<'a> { +pub fn percent_encode>(input: &[u8], ascii_set: T) -> PercentEncode<'_> { PercentEncode { bytes: input, ascii_set: ascii_set.into(), @@ -133,10 +133,7 @@ pub fn percent_encode<'a, T: Into>(input: &'a [u8], ascii_set: T) -> P /// assert_eq!(utf8_percent_encode("foo bar?", NON_ALPHANUMERIC).to_string(), "foo%20bar%3F"); /// ``` #[inline] -pub fn utf8_percent_encode<'a, T: Into>( - input: &'a str, - ascii_set: T, -) -> PercentEncode<'a> { +pub fn utf8_percent_encode>(input: &str, ascii_set: T) -> PercentEncode<'_> { percent_encode(input.as_bytes(), ascii_set) } @@ -382,6 +379,7 @@ mod tests { #[test] fn percent_encode_accepts_ascii_set_ref() { + #[allow(clippy::needless_borrows_for_generic_args)] // tests prior behavior let encoded = percent_encode(b"foo bar?", &AsciiSet::EMPTY); assert_eq!(encoded.collect::(), "foo bar?"); } @@ -415,6 +413,7 @@ mod tests { #[test] fn utf8_percent_encode_accepts_ascii_set_ref() { + #[allow(clippy::needless_borrows_for_generic_args)] // tests prior behavior let encoded = super::utf8_percent_encode("foo bar?", &AsciiSet::EMPTY); assert_eq!(encoded.collect::(), "foo bar?"); }