Remove superfluous early returns

This commit is contained in:
Lukas Wirth 2022-06-17 17:49:25 +02:00
parent 85b68b1f7d
commit d97a8ee865
8 changed files with 41 additions and 59 deletions

View file

@ -65,11 +65,8 @@ pub(crate) fn complete_expr_path(acc: &mut Completions, ctx: &CompletionContext)
.into_iter()
.flat_map(|it| hir::Trait::from(it).items(ctx.sema.db))
.for_each(|item| add_assoc_item(acc, ctx, item)),
Qualified::With { resolution, .. } => {
let resolution = match resolution {
Some(it) => it,
None => return,
};
Qualified::With { resolution: None, .. } => {}
Qualified::With { resolution: Some(resolution), .. } => {
// Add associated types on type parameters and `Self`.
ctx.scope.assoc_type_shorthand_candidates(resolution, |_, alias| {
acc.add_type_alias(ctx, alias);