Skip to content

Commit 3b12fc3

Browse files
committed
Use sort_unstable on primitive types
Clippy emits a few warnings of type: warning: used `sort` on primitive type `u32` As suggested, use `sort_unstable` on `u32` and `usize` primitives.
1 parent e870e06 commit 3b12fc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/policy/semantic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
491491
/// which appear in the policy
492492
pub fn relative_timelocks(&self) -> Vec<u32> {
493493
let mut ret = self.real_relative_timelocks();
494-
ret.sort();
494+
ret.sort_unstable();
495495
ret.dedup();
496496
ret
497497
}
@@ -519,7 +519,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
519519
/// which appear in the policy
520520
pub fn absolute_timelocks(&self) -> Vec<u32> {
521521
let mut ret = self.real_absolute_timelocks();
522-
ret.sort();
522+
ret.sort_unstable();
523523
ret.dedup();
524524
ret
525525
}
@@ -599,7 +599,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
599599
// Not enough branches are satisfiable
600600
None
601601
} else {
602-
sublens.sort();
602+
sublens.sort_unstable();
603603
Some(sublens[0..k].iter().cloned().sum::<usize>())
604604
}
605605
}

0 commit comments

Comments
 (0)