Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Jul 6, 2020
1 parent 7fb2693 commit 8872ec3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/liballoc/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,10 +1114,12 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// #![feature(deque_range)]
///
/// use std::collections::VecDeque;
///
/// let v: VecDeque<_> = vec![1, 2, 3].into_iter().collect();
/// let range = v.iter_rage(2..).copied().collect::<VecDeque<_>>();
/// let range = v.range(2..).copied().collect::<VecDeque<_>>();
/// assert_eq!(range, [3]);
///
/// // A full range covers all contents
Expand Down Expand Up @@ -1151,6 +1153,8 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// #![feature(deque_range)]
///
/// use std::collections::VecDeque;
///
/// let mut v: VecDeque<_> = vec![1, 2, 3].into_iter().collect();
Expand Down
6 changes: 3 additions & 3 deletions src/liballoc/collections/vec_deque/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ fn test_range() {
for len in 0..=cap {
for tail in 0..=cap {
for start in 0..=len {
for end in drain_start..=len {
for end in start..=len {
tester.tail = tail;
tester.head = tail;
for i in 0..len {
Expand All @@ -279,7 +279,7 @@ fn test_range_mut() {
for len in 0..=cap {
for tail in 0..=cap {
for start in 0..=len {
for end in drain_start..=len {
for end in start..=len {
tester.tail = tail;
tester.head = tail;
for i in 0..len {
Expand All @@ -290,7 +290,7 @@ fn test_range_mut() {
let tail_was = tester.tail;

// Check that we iterate over the correct values
let range: VecDeque<_> = tester.range_mut(start..end).copied().collect();
let range: VecDeque<_> = tester.range_mut(start..end).map(|v| *v).collect();
let expected: VecDeque<_> = (start..end).collect();
assert_eq!(range, expected);

Expand Down
1 change: 1 addition & 0 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#![feature(const_in_array_repeat_expressions)]
#![cfg_attr(bootstrap, feature(const_if_match))]
#![feature(cow_is_borrowed)]
#![feature(deque_range)]
#![feature(dispatch_from_dyn)]
#![feature(core_intrinsics)]
#![feature(container_error_extra)]
Expand Down

0 comments on commit 8872ec3

Please sign in to comment.