on master help sign in
Add IntoIterator implementation for Selection
e91289fPascal Kuthe
helix-core/src/selection.rs+9
@@ -661,6 +661,15 @@ impl<'a> IntoIterator for &'a Selection {
661 }
661 }
662}
662}
663
663
664+impl IntoIterator for Selection {
665+ type Item = Range;
666+ type IntoIter = smallvec::IntoIter<[Range; 1]>;
667+
668+ fn into_iter(self) -> smallvec::IntoIter<[Range; 1]> {
669+ self.ranges.into_iter()
670+ }
671+}
672+
664// TODO: checkSelection -> check if valid for doc length && sorted
673// TODO: checkSelection -> check if valid for doc length && sorted
665
674
666pub fn keep_or_remove_matches(
675pub fn keep_or_remove_matches(