Skip to content

Commit

Permalink
Correct drain implementations in libcollectionstest
Browse files Browse the repository at this point in the history
  • Loading branch information
mystor committed Oct 19, 2015
1 parent 493355d commit dec0ea0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libcollectionstest/vec_deque.rs
Expand Up @@ -475,7 +475,7 @@ fn test_drain() {
let mut d: VecDeque<i32> = VecDeque::new();

{
let mut iter = d.drain();
let mut iter = d.drain(..);

assert_eq!(iter.size_hint(), (0, Some(0)));
assert_eq!(iter.next(), None);
Expand All @@ -492,7 +492,7 @@ fn test_drain() {
d.push_back(i);
}

assert_eq!(d.drain().collect::<Vec<_>>(), [0, 1, 2, 3, 4]);
assert_eq!(d.drain(..).collect::<Vec<_>>(), [0, 1, 2, 3, 4]);
assert!(d.is_empty());
}

Expand All @@ -506,7 +506,7 @@ fn test_drain() {
d.push_front(i);
}

assert_eq!(d.drain().collect::<Vec<_>>(), [8,7,6,0,1,2,3,4]);
assert_eq!(d.drain(..).collect::<Vec<_>>(), [8,7,6,0,1,2,3,4]);
assert!(d.is_empty());
}

Expand All @@ -521,7 +521,7 @@ fn test_drain() {
}

{
let mut it = d.drain();
let mut it = d.drain(..);
assert_eq!(it.size_hint(), (8, Some(8)));
assert_eq!(it.next(), Some(8));
assert_eq!(it.size_hint(), (7, Some(7)));
Expand Down

0 comments on commit dec0ea0

Please sign in to comment.