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:
mike
2023-04-14 21:51:38 +03:00
committed by GitHub
parent 6cedc05384
commit a122e55129
7 changed files with 22 additions and 37 deletions

View File

@ -213,9 +213,7 @@ impl Iterator for RangeIterator {
self.curr.partial_cmp(&self.end)
};
let ordering = if let Some(ord) = ordering {
ord
} else {
let Some(ordering) = ordering else {
self.done = true;
return Some(Value::Error {
error: Box::new(ShellError::CannotCreateRange { span: self.span }),