Skip to content

Commit 3a73c7d

Browse files
committed
fixup! Add IntoIterator<Item = &Pk> for ConcretePolicy
1 parent 446f3ac commit 3a73c7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/policy/concrete.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ impl<Pk: MiniscriptKey> ForEachKey<Pk> for Policy<Pk> {
164164
}
165165

166166
impl<'a, Pk: MiniscriptKey> IntoIterator for &'a Policy<Pk> {
167-
type Item = &'a Pk;
168-
type IntoIter = Box<dyn Iterator<Item = &'a Pk> + 'a>;
167+
type Item = ForEach<'a, Pk>;
168+
type IntoIter = Box<dyn Iterator<Item = ForEach<'a, Pk>> + 'a>;
169169

170170
fn into_iter(self) -> Self::IntoIter {
171171
use std::iter;
172172

173173
match *self {
174-
Policy::Key(ref pk) => Box::new(iter::once(pk)),
174+
Policy::Key(ref pk) => Box::new(iter::once(ForEach::Key(pk))),
175175
Policy::Threshold(_, ref subs) | Policy::And(ref subs) => {
176176
Box::new(subs.iter().map(|s| s.into_iter()).flatten())
177177
}

0 commit comments

Comments
 (0)