Skip to content

Commit a432f2a

Browse files
committed
Fixes cargo clippy.
1 parent ee29828 commit a432f2a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

sway-core/src/engine_threading.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,15 @@ impl<T: OrdWithEngines> OrdWithEngines for Option<T> {
358358

359359
impl<T: OrdWithEngines> OrdWithEngines for Vec<T> {
360360
fn cmp(&self, other: &Self, ctx: &OrdWithEnginesContext) -> Ordering {
361-
if self.len() == other.len() {
362-
self.iter()
361+
match self.len().cmp(&other.len()) {
362+
Ordering::Less => Ordering::Less,
363+
Ordering::Equal => self
364+
.iter()
363365
.zip(other.iter())
364366
.fold(Ordering::Equal, |accumulator, values| {
365367
accumulator.then_with(|| values.0.cmp(values.1, ctx))
366-
})
367-
} else if self.len() < other.len() {
368-
Ordering::Less
369-
} else {
370-
Ordering::Greater
368+
}),
369+
Ordering::Greater => Ordering::Greater,
371370
}
372371
}
373372
}

0 commit comments

Comments
 (0)