1
Fork 0

use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)

This commit is contained in:
Matthias Krüger 2020-09-18 18:33:37 +02:00
parent 10b3595ba6
commit c690c82ad4
8 changed files with 28 additions and 58 deletions

View file

@ -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);