Skip to content

Commit

Permalink
Revert "Slightly refactor VecDeque implementation"
Browse files Browse the repository at this point in the history
This reverts commit 6ce76ac.
  • Loading branch information
alexcrichton committed Oct 5, 2018
1 parent 90b9469 commit 70ae43f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/liballoc/collections/vec_deque.rs
Expand Up @@ -1024,7 +1024,7 @@ impl<T> VecDeque<T> {
iter: Iter {
tail: drain_tail,
head: drain_head,
ring: unsafe { self.buffer_as_slice() },
ring: unsafe { self.buffer_as_mut_slice() },
},
}
}
Expand Down Expand Up @@ -2593,8 +2593,8 @@ impl<T> From<VecDeque<T>> for Vec<T> {
let mut right_offset = 0;
for i in left_edge..right_edge {
right_offset = (i - left_edge) % (cap - right_edge);
let src = right_edge + right_offset;
ptr::swap(buf.add(i), buf.add(src));
let src: isize = (right_edge + right_offset) as isize;
ptr::swap(buf.add(i), buf.offset(src));
}
let n_ops = right_edge - left_edge;
left_edge += n_ops;
Expand Down

0 comments on commit 70ae43f

Please sign in to comment.