Skip to content

Commit d5662da

Browse files
committed
Remove redundant closure
clippy emits: error: redundant closure As suggested, remove the redundant closure.
1 parent 90f1585 commit d5662da

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/policy/compiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ mod tests {
16171617
.map(|pubkey| Arc::new(Concrete::Key(*pubkey)))
16181618
.collect();
16191619
let thresh_res = Concrete::Thresh(keys.len() - 1, keys).compile::<Legacy>();
1620-
let ops_count = thresh_res.clone().and_then(|m| Ok(m.ext.ops.op_count()));
1620+
let ops_count = thresh_res.clone().map(|m| m.ext.ops.op_count());
16211621
assert_eq!(
16221622
thresh_res,
16231623
Err(CompilerError::LimitsExceeded),

src/policy/concrete.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ mod compiler_tests {
11051105
let policies: Vec<Arc<Concrete<String>>> = vec!["pk(A)", "pk(B)", "pk(C)", "pk(D)"]
11061106
.into_iter()
11071107
.map(|st| policy_str!("{}", st))
1108-
.map(|p| Arc::new(p))
1108+
.map(Arc::new)
11091109
.collect();
11101110

11111111
let combinations = generate_combination(&policies, 1.0, 2);
@@ -1133,10 +1133,7 @@ mod compiler_tests {
11331133
let expected_comb = vec![comb_a, comb_b, comb_c, comb_d]
11341134
.into_iter()
11351135
.map(|sub_pol| {
1136-
(
1137-
0.25,
1138-
Arc::new(Policy::Thresh(2, sub_pol.into_iter().map(|p| Arc::new(p)).collect())),
1139-
)
1136+
(0.25, Arc::new(Policy::Thresh(2, sub_pol.into_iter().map(Arc::new).collect())))
11401137
})
11411138
.collect::<Vec<_>>();
11421139
assert_eq!(combinations, expected_comb);

0 commit comments

Comments
 (0)