Skip to content

Commit

Permalink
style: Use idiomatic not().then_some()
Browse files Browse the repository at this point in the history
Co-authored-by: Ferdinand Sauer <[email protected]>
  • Loading branch information
aszepieniec and jan-ferdinand committed Sep 23, 2024
1 parent 5cdf137 commit 2c4db3c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions triton-constraint-circuit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ fn random_circuit_leaf<'a, II: InputIndicator + Arbitrary<'a>>(
mod tests {
use std::collections::hash_map::DefaultHasher;
use std::hash::Hasher;
use std::ops::Not;

use itertools::Itertools;
use ndarray::Array2;
Expand Down Expand Up @@ -1937,13 +1938,7 @@ mod tests {
.cycle()
.skip(substitution_node_index % num_nodes)
.take(num_nodes)
.find_map(|(id, monad)| {
if monad.circuit.borrow().is_zero() {
None
} else {
Some(id)
}
})
.find_map(|(id, monad)| monad.circuit.borrow().is_zero().not().then_some(id))
.expect("no suitable nodes to substitute");

let degree_lowering_info = DegreeLoweringInfo {
Expand Down

0 comments on commit 2c4db3c

Please sign in to comment.