use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
This commit is contained in:
parent
10b3595ba6
commit
c690c82ad4
8 changed files with 28 additions and 58 deletions
|
@ -152,11 +152,8 @@ impl SymbolMangler<'tcx> {
|
|||
let _ = write!(self.out, "{}", ident.len());
|
||||
|
||||
// Write a separating `_` if necessary (leading digit or `_`).
|
||||
match ident.chars().next() {
|
||||
Some('_' | '0'..='9') => {
|
||||
self.push("_");
|
||||
}
|
||||
_ => {}
|
||||
if let Some('_' | '0'..='9') = ident.chars().next() {
|
||||
self.push("_");
|
||||
}
|
||||
|
||||
self.push(ident);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue