use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user