Skip to content

Commit

Permalink
Add IntoIterator for &Vec<>
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Sep 9, 2024
1 parent f57d245 commit 94b37d5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions soroban-sdk/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,18 @@ where
}
}

impl<T> IntoIterator for &Vec<T>
where
T: IntoVal<Env, Val> + TryFromVal<Env, Val>,
{
type Item = T;
type IntoIter = UnwrappedIter<VecTryIter<T>, T, T::Error>;

fn into_iter(self) -> Self::IntoIter {
self.to_owned().into_iter()
}
}

impl<T> Vec<T>
where
T: IntoVal<Env, Val> + TryFromVal<Env, Val>,
Expand Down

0 comments on commit 94b37d5

Please sign in to comment.