Skip to content

Commit f2f95fa

Browse files
committed
cargo fmt
1 parent a6340fe commit f2f95fa

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/policy/concrete.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,9 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
683683
Policy::Threshold(_, ref subs) | Policy::And(ref subs) => {
684684
subs.iter().all(|sub| sub.real_for_each_key(&mut *pred))
685685
}
686-
Policy::Or(ref subs) => subs.iter().all(|(_, sub)| sub.real_for_each_key(&mut *pred)),
686+
Policy::Or(ref subs) => subs
687+
.iter()
688+
.all(|(_, sub)| sub.real_for_each_key(&mut *pred)),
687689
}
688690
}
689691

@@ -1356,15 +1358,19 @@ mod compiler_tests {
13561358

13571359
#[cfg(test)]
13581360
mod tests {
1359-
use super::*;
13601361
use std::str::FromStr;
13611362

1363+
use super::*;
1364+
13621365
#[test]
13631366
fn for_each_key() {
13641367
let liquid_pol = Policy::<String>::from_str(
13651368
"or(and(older(4096),thresh(2,pk(A),pk(B),pk(C))),thresh(11,pk(F1),pk(F2),pk(F3),pk(F4),pk(F5),pk(F6),pk(F7),pk(F8),pk(F9),pk(F10),pk(F11),pk(F12),pk(F13),pk(F14)))").unwrap();
13661369
let mut count = 0;
1367-
assert!(liquid_pol.for_each_key(|_| { count +=1; true }));
1370+
assert!(liquid_pol.for_each_key(|_| {
1371+
count += 1;
1372+
true
1373+
}));
13681374
assert_eq!(count, 17);
13691375
}
13701376
}

src/policy/semantic.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
7777
| Policy::Hash160(..)
7878
| Policy::After(..)
7979
| Policy::Older(..) => true,
80-
Policy::Threshold(_, ref subs) => subs.iter().all(|sub| sub.real_for_each_key(&mut *pred)),
80+
Policy::Threshold(_, ref subs) => {
81+
subs.iter().all(|sub| sub.real_for_each_key(&mut *pred))
82+
}
8183
}
8284
}
8385

@@ -977,7 +979,10 @@ mod tests {
977979
let liquid_pol = StringPolicy::from_str(
978980
"or(and(older(4096),thresh(2,pk(A),pk(B),pk(C))),thresh(11,pk(F1),pk(F2),pk(F3),pk(F4),pk(F5),pk(F6),pk(F7),pk(F8),pk(F9),pk(F10),pk(F11),pk(F12),pk(F13),pk(F14)))").unwrap();
979981
let mut count = 0;
980-
assert!(liquid_pol.for_each_key(|_| { count +=1; true }));
982+
assert!(liquid_pol.for_each_key(|_| {
983+
count += 1;
984+
true
985+
}));
981986
assert_eq!(count, 17);
982987
}
983988
}

0 commit comments

Comments
 (0)