Skip to content

Commit 26e96f1

Browse files
committed
clippy: remove .any(|x| x) construction in the compiler
1 parent acbd120 commit 26e96f1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/policy/compiler.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,11 +693,10 @@ fn insert_elem<Pk: MiniscriptKey, Ctx: ScriptContext>(
693693
// cost, don't consider this element.
694694
let is_worse = map
695695
.iter()
696-
.map(|(existing_key, existing_elem)| {
696+
.any(|(existing_key, existing_elem)| {
697697
let existing_elem_cost = existing_elem.cost_1d(sat_prob, dissat_prob);
698698
existing_key.is_subtype(elem_key) && existing_elem_cost <= elem_cost
699-
})
700-
.any(|x| x);
699+
});
701700
if !is_worse {
702701
// If the element is not worse any element in the map, remove elements
703702
// whose subtype is the current element and have worse cost.

0 commit comments

Comments
 (0)