forked from extern/nushell
use let-else
syntax where possible (#8886)
# Description this pr changes some `if-let`s to `let-else`s # User-Facing Changes none
This commit is contained in:
@ -5,14 +5,14 @@ pub fn get_columns<'a>(input: impl IntoIterator<Item = &'a Value>) -> Vec<String
|
||||
let mut columns = vec![];
|
||||
|
||||
for item in input {
|
||||
if let Value::Record { cols, .. } = item {
|
||||
for col in cols {
|
||||
if !columns.contains(col) {
|
||||
columns.push(col.to_string());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let Value::Record { cols, .. } = item else {
|
||||
return vec![];
|
||||
};
|
||||
|
||||
for col in cols {
|
||||
if !columns.contains(col) {
|
||||
columns.push(col.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user