if $c:expr { Some($r:expr) } else { None }
=>> $c.then(|| $r)
This commit is contained in:
parent
af3c8b2726
commit
8751fa1a9a
54 changed files with 159 additions and 281 deletions
|
@ -1700,11 +1700,9 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
|
|||
let crate_mod =
|
||||
Res::Def(DefKind::Mod, crate_id.as_def_id());
|
||||
|
||||
if filter_fn(crate_mod) {
|
||||
Some(TypoSuggestion::typo_from_ident(*ident, crate_mod))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
filter_fn(crate_mod).then(|| {
|
||||
TypoSuggestion::typo_from_ident(*ident, crate_mod)
|
||||
})
|
||||
})
|
||||
}));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue