Add IntoIterator implementation for Selection

This commit is contained in:
Pascal Kuthe 2023-03-09 22:09:12 +01:00 committed by Blaž Hrastnik
parent 9b4326b18b
commit e91289fda1

View File

@ -661,6 +661,15 @@ fn into_iter(self) -> std::slice::Iter<'a, Range> {
}
}
impl IntoIterator for Selection {
type Item = Range;
type IntoIter = smallvec::IntoIter<[Range; 1]>;
fn into_iter(self) -> smallvec::IntoIter<[Range; 1]> {
self.ranges.into_iter()
}
}
// TODO: checkSelection -> check if valid for doc length && sorted
pub fn keep_or_remove_matches(