+8
-1
lines changedFilter options
+8
-1
lines changed Original file line number Diff line number Diff line change
@@ -356,6 +356,7 @@ pub unsafe trait ProxiedInRepeated: Proxied + SealedInternal {
356
356
}
357
357
358
358
/// An iterator over the values inside of a [`View<Repeated<T>>`](RepeatedView).
359
+
#[derive(Clone)]
359
360
pub struct RepeatedIter<'msg, T> {
360
361
view: RepeatedView<'msg, T>,
361
362
current_index: usize,
@@ -688,8 +689,14 @@ mod tests {
688
689
}
689
690
690
691
#[gtest]
691
-
fn test_repeated_iter_into_proxied() {
692
+
fn test_repeated_iter() {
692
693
let r: Repeated<i32> = [0, 1, 2, 3].into_iter().into_proxied(Private);
693
694
assert_that!(r.as_view(), elements_are![eq(0), eq(1), eq(2), eq(3)]);
695
+
696
+
let mut iter = r.as_view().into_iter();
697
+
assert_that!(iter.next(), eq(Some(0)));
698
+
let mut clone = iter.clone();
699
+
assert_that!(clone.next(), eq(Some(1)));
700
+
assert_that!(iter.next(), eq(Some(1)));
694
701
}
695
702
}
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4