clippy::perf fixes

single_char_pattern and to_string_in_format_args
This commit is contained in:
Matthias Krüger 2022-02-03 21:44:47 +01:00
parent 4e8fb743cc
commit de2abc29e9
4 changed files with 9 additions and 9 deletions

View file

@ -1702,11 +1702,11 @@ impl<'a> Parser<'a> {
// Try to lowercase the prefix if it's a valid base prefix.
fn fix_base_capitalisation(s: &str) -> Option<String> {
if let Some(stripped) = s.strip_prefix("B") {
if let Some(stripped) = s.strip_prefix('B') {
Some(format!("0b{stripped}"))
} else if let Some(stripped) = s.strip_prefix("O") {
} else if let Some(stripped) = s.strip_prefix('O') {
Some(format!("0o{stripped}"))
} else if let Some(stripped) = s.strip_prefix("X") {
} else if let Some(stripped) = s.strip_prefix('X') {
Some(format!("0x{stripped}"))
} else {
None