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

@ -534,11 +534,8 @@ impl<'a> ModuleData<'a> {
if ns != TypeNS {
return;
}
match binding.res() {
Res::Def(DefKind::Trait | DefKind::TraitAlias, _) => {
collected_traits.push((name, binding))
}
_ => (),
if let Res::Def(DefKind::Trait | DefKind::TraitAlias, _) = binding.res() {
collected_traits.push((name, binding))
}
});
*traits = Some(collected_traits.into_boxed_slice());