Replace single-branch match with if let

This commit is contained in:
Nick Rolfe
2020-11-16 18:43:54 +00:00
parent 68c97a2d13
commit 1a9663ff7d

View File

@@ -478,10 +478,7 @@ impl Visitor<'_> {
_ => {}
}
}
node_types::FieldTypeInfo::Multiple {
types,
..
} => {
node_types::FieldTypeInfo::Multiple { types, .. } => {
return self.type_matches_set(tp, types);
}
}
@@ -493,13 +490,10 @@ impl Visitor<'_> {
return true;
}
for other in types.iter() {
match &self.schema.get(other).unwrap().kind {
EntryKind::Union { members } => {
if self.type_matches_set(tp, members) {
return true;
}
if let EntryKind::Union { members } = &self.schema.get(other).unwrap().kind {
if self.type_matches_set(tp, members) {
return true;
}
_ => {}
}
}
false