fix clippy::single_char_pattern perf findings
This commit is contained in:
parent
1796de7bb1
commit
97e844a032
19 changed files with 36 additions and 36 deletions
|
@ -1213,7 +1213,7 @@ pub fn get_cmd_lint_options(
|
|||
if lint_name == "help" {
|
||||
describe_lints = true;
|
||||
} else {
|
||||
lint_opts_with_position.push((arg_pos, lint_name.replace("-", "_"), level));
|
||||
lint_opts_with_position.push((arg_pos, lint_name.replace('-', "_"), level));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -335,7 +335,7 @@ fn build_options<O: Default>(
|
|||
Some((k, v)) => (k.to_string(), Some(v)),
|
||||
};
|
||||
|
||||
let option_to_lookup = key.replace("-", "_");
|
||||
let option_to_lookup = key.replace('-', "_");
|
||||
match descrs.iter().find(|(name, ..)| *name == option_to_lookup) {
|
||||
Some((_, setter, type_desc, _)) => {
|
||||
if !setter(&mut op, value) {
|
||||
|
|
|
@ -85,7 +85,7 @@ pub fn find_crate_name(sess: &Session, attrs: &[ast::Attribute], input: &Input)
|
|||
);
|
||||
sess.err(&msg);
|
||||
} else {
|
||||
return validate(s.replace("-", "_"), None);
|
||||
return validate(s.replace('-', "_"), None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue