Skip to content

Commit

Permalink
Fixes cargo clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
esdrubal committed Nov 20, 2024
1 parent 6785778 commit 465d3fc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions sway-core/src/engine_threading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,15 @@ impl<T: OrdWithEngines> OrdWithEngines for Option<T> {

impl<T: OrdWithEngines> OrdWithEngines for Vec<T> {
fn cmp(&self, other: &Self, ctx: &OrdWithEnginesContext) -> Ordering {
if self.len() == other.len() {
self.iter()
match self.len().cmp(&other.len()) {
Ordering::Less => Ordering::Less,
Ordering::Equal => self
.iter()
.zip(other.iter())
.fold(Ordering::Equal, |accumulator, values| {
accumulator.then_with(|| values.0.cmp(values.1, ctx))
})
} else if self.len() < other.len() {
Ordering::Less
} else {
Ordering::Greater
}),
Ordering::Greater => Ordering::Greater,
}
}
}
Expand Down

0 comments on commit 465d3fc

Please sign in to comment.