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
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue