Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
joshka committed Sep 26, 2024
1 parent 23bd642 commit 540ecd1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions percent_encoding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AsciiSet>>(input: &'a [u8], ascii_set: T) -> PercentEncode<'a> {
pub fn percent_encode<T: Into<AsciiSet>>(input: &[u8], ascii_set: T) -> PercentEncode<'_> {
PercentEncode {
bytes: input,
ascii_set: ascii_set.into(),
Expand All @@ -133,10 +133,7 @@ pub fn percent_encode<'a, T: Into<AsciiSet>>(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<AsciiSet>>(
input: &'a str,
ascii_set: T,
) -> PercentEncode<'a> {
pub fn utf8_percent_encode<T: Into<AsciiSet>>(input: &str, ascii_set: T) -> PercentEncode<'_> {
percent_encode(input.as_bytes(), ascii_set)
}

Expand Down Expand Up @@ -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::<String>(), "foo bar?");
}
Expand Down Expand Up @@ -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::<String>(), "foo bar?");
}
Expand Down

0 comments on commit 540ecd1

Please sign in to comment.