use matches!() macro for simple if let conditions

This commit is contained in:
Matthias Krüger 2020-09-18 19:11:06 +02:00
parent 2c69266c06
commit 40dddd3305
15 changed files with 33 additions and 36 deletions

View file

@ -1529,7 +1529,7 @@ impl<'a> TraitDef<'a> {
}
}
let is_tuple = if let ast::VariantData::Tuple(..) = struct_def { true } else { false };
let is_tuple = matches!(struct_def, ast::VariantData::Tuple(..));
match (just_spans.is_empty(), named_idents.is_empty()) {
(false, false) => cx.span_bug(
self.span,