Skip to content

Commit

Permalink
fixup! Add IntoIterator<Item = &Pk> for ConcretePolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed Aug 17, 2021
1 parent 446f3ac commit 3a73c7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/policy/concrete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ impl<Pk: MiniscriptKey> ForEachKey<Pk> for Policy<Pk> {
}

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

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

match *self {
Policy::Key(ref pk) => Box::new(iter::once(pk)),
Policy::Key(ref pk) => Box::new(iter::once(ForEach::Key(pk))),
Policy::Threshold(_, ref subs) | Policy::And(ref subs) => {
Box::new(subs.iter().map(|s| s.into_iter()).flatten())
}
Expand Down

0 comments on commit 3a73c7d

Please sign in to comment.