diff options
| author | bors <bors@rust-lang.org> | 2014-07-23 21:41:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-23 21:41:14 +0000 |
| commit | fb72c4767fa423649feeb197b50385c1fa0a6fd5 (patch) | |
| tree | 85beee9373b61bc02cc53b94d11fe128e9ab2f1b /src/libsync | |
| parent | b3a732a3eab60862068b1006973de5924bcda9e2 (diff) | |
| parent | 71a75cc2ce6d6eed2557e6c585e81abcdad86827 (diff) | |
| download | rust-fb72c4767fa423649feeb197b50385c1fa0a6fd5.tar.gz rust-fb72c4767fa423649feeb197b50385c1fa0a6fd5.zip | |
auto merge of #15611 : brson/rust/pushpop, r=alexcrichton
This fixes naming conventions for `push`/`pop` from either end of a structure by partially implementing @erickt's suggestion from https://github.com/rust-lang/rust/issues/10852#issuecomment-30823343, namely: * push/pop from the 'back' are called `push` and `pop`. * push/pop from the 'front' are called `push_front` and `pop_front`. * `push`/`pop` are declared on the `MutableSeq` trait. * Implement `MutableSeq` for `Vec`, `DList`, and `RingBuf`. * Add `MutableSeq` to the prelude. I did not make any further refactorings because there is some more extensive thought that needs to be put into the collections traits. This is an easy first step that should close https://github.com/rust-lang/rust/issues/10852. I left the `push_back` and `pop_back` methods on `DList` and `RingBuf` deprecated. Because `MutableSeq` is in the prelude it shouldn't break many, but it is a breaking change.
Diffstat (limited to 'src/libsync')
| -rw-r--r-- | src/libsync/deque.rs | 2 | ||||
| -rw-r--r-- | src/libsync/raw.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libsync/deque.rs b/src/libsync/deque.rs index 913a58010d4..c541cc02774 100644 --- a/src/libsync/deque.rs +++ b/src/libsync/deque.rs @@ -55,7 +55,7 @@ use core::prelude::*; use alloc::arc::Arc; use alloc::heap::{allocate, deallocate}; use alloc::boxed::Box; -use collections::Vec; +use collections::{Vec, MutableSeq}; use core::kinds::marker; use core::mem::{forget, min_align_of, size_of, transmute}; use core::ptr; diff --git a/src/libsync/raw.rs b/src/libsync/raw.rs index d056566bb9a..1bdf24ea7dd 100644 --- a/src/libsync/raw.rs +++ b/src/libsync/raw.rs @@ -22,7 +22,7 @@ use core::finally::Finally; use core::kinds::marker; use core::mem; use core::ty::Unsafe; -use collections::Vec; +use collections::{Vec, MutableSeq}; use mutex; use comm::{Receiver, Sender, channel}; |
