fix clippy issues (#301)

This commit is contained in:
John Vandenberg 2023-01-18 16:07:27 +08:00 committed by GitHub
parent 87e01ff32f
commit 7e64a98fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ pub fn parse(t: &str) -> Result<PathTemplate> {
s = State::Parameter; s = State::Parameter;
} else if c == '}' { } else if c == '}' {
return Err(Error::InvalidPath("unexpected }".to_string())); return Err(Error::InvalidPath("unexpected }".to_string()));
} else if c != '/' || a.chars().last() != Some('/') { } else if c != '/' || !a.ends_with('/') {
a.push(c); a.push(c);
} }
} }

View File

@ -102,7 +102,7 @@ pub(crate) fn sanitize(input: &str, case: Case) -> String {
"-1" => "minus1".to_string(), "-1" => "minus1".to_string(),
_ => to_case( _ => to_case(
&input &input
.replace("'", "") .replace('\'', "")
.replace(|c: char| !is_xid_continue(c), "-"), .replace(|c: char| !is_xid_continue(c), "-"),
), ),
}; };