Skip to content

Commit 19fc4e8

Browse files
committed
Implement IntoIterator for IndexVec
This fixes a clippy warning and slightly improves ergonomic. This is technically a breaking change, but it is unlikely to break code in practice, since `IntoIterator` is in Rust's prelude.
1 parent 28bf11d commit 19fc4e8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/seq/index.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,15 @@ impl IndexVec {
8585
IndexVec::USize(ref v) => IndexVecIter::USize(v.iter()),
8686
}
8787
}
88+
}
89+
90+
impl IntoIterator for IndexVec {
91+
type Item = usize;
92+
type IntoIter = IndexVecIntoIter;
8893

8994
/// Convert into an iterator over the indices as a sequence of `usize` values
9095
#[inline]
91-
pub fn into_iter(self) -> IndexVecIntoIter {
96+
fn into_iter(self) -> IndexVecIntoIter {
9297
match self {
9398
IndexVec::U32(v) => IndexVecIntoIter::U32(v.into_iter()),
9499
IndexVec::USize(v) => IndexVecIntoIter::USize(v.into_iter()),

0 commit comments

Comments
 (0)