Skip to content

Commit 4fbf107

Browse files
committed
Unified: Use if let instead of match.
1 parent 3a9e12a commit 4fbf107

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎unified/extractor/src/languages/swift/adapter.rs‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,12 @@ fn field_entries(node: &Value) -> Vec<(&str, &Value)> {
210210
/// arrays recursively to preserve the intended collection elision.
211211
fn children_of(value: &Value) -> Vec<&Value> {
212212
fn collect<'a>(value: &'a Value, children: &mut Vec<&'a Value>) {
213-
match value {
214-
Value::Array(items) => {
215-
for item in items {
216-
collect(item, children);
217-
}
213+
if let Value::Array(items) = value {
214+
for item in items {
215+
collect(item, children);
218216
}
219-
other => children.push(other),
217+
} else {
218+
children.push(value);
220219
}
221220
}
222221

0 commit comments

Comments
 (0)