Skip to content

Commit d28b7ea

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

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/policy/compiler.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,10 @@ fn insert_elem<Pk: MiniscriptKey, Ctx: ScriptContext>(
691691
// Check whether the new element is worse than any existing element. If there
692692
// is an element which is a subtype of the current element and has better
693693
// cost, don't consider this element.
694-
let is_worse = map
695-
.iter()
696-
.map(|(existing_key, existing_elem)| {
697-
let existing_elem_cost = existing_elem.cost_1d(sat_prob, dissat_prob);
698-
existing_key.is_subtype(elem_key) && existing_elem_cost <= elem_cost
699-
})
700-
.any(|x| x);
694+
let is_worse = map.iter().any(|(existing_key, existing_elem)| {
695+
let existing_elem_cost = existing_elem.cost_1d(sat_prob, dissat_prob);
696+
existing_key.is_subtype(elem_key) && existing_elem_cost <= elem_cost
697+
});
701698
if !is_worse {
702699
// If the element is not worse any element in the map, remove elements
703700
// whose subtype is the current element and have worse cost.

0 commit comments

Comments
 (0)