Fix clippy::single_match

This commit is contained in:
Alan Du 2019-06-03 10:01:10 -04:00
parent 354db651da
commit ecd420636e
9 changed files with 51 additions and 76 deletions

View file

@ -16,8 +16,8 @@ pub(super) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) {
fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) {
for receiver in receiver.autoderef(ctx.db) {
match receiver {
Ty::Apply(a_ty) => match a_ty.ctor {
if let Ty::Apply(a_ty) = receiver {
match a_ty.ctor {
TypeCtor::Adt(AdtDef::Struct(s)) => {
for field in s.fields(ctx.db) {
acc.add_field(ctx, field, &a_ty.parameters);
@ -30,8 +30,7 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty)
}
}
_ => {}
},
_ => {}
}
};
}
}