mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Fix clippy::single_match
This commit is contained in:
parent
354db651da
commit
ecd420636e
9 changed files with 51 additions and 76 deletions
|
@ -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)
|
|||
}
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue