about summary refs log tree commit diff
path: root/src/libstd/path
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-23 21:41:14 +0000
committerbors <bors@rust-lang.org>2014-07-23 21:41:14 +0000
commitfb72c4767fa423649feeb197b50385c1fa0a6fd5 (patch)
tree85beee9373b61bc02cc53b94d11fe128e9ab2f1b /src/libstd/path
parentb3a732a3eab60862068b1006973de5924bcda9e2 (diff)
parent71a75cc2ce6d6eed2557e6c585e81abcdad86827 (diff)
downloadrust-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/libstd/path')
-rw-r--r--src/libstd/path/mod.rs2
-rw-r--r--src/libstd/path/posix.rs2
-rw-r--r--src/libstd/path/windows.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs
index ececfab5f74..0c93f8e6de9 100644
--- a/src/libstd/path/mod.rs
+++ b/src/libstd/path/mod.rs
@@ -65,7 +65,7 @@ println!("path exists: {}", path.exists());
 
 #![experimental]
 
-use collections::Collection;
+use collections::{Collection, MutableSeq};
 use c_str::CString;
 use clone::Clone;
 use fmt;
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index 007686aa05c..877ca2c7e01 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -13,7 +13,7 @@
 use c_str::{CString, ToCStr};
 use clone::Clone;
 use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
-use collections::Collection;
+use collections::{Collection, MutableSeq};
 use from_str::FromStr;
 use hash;
 use io::Writer;
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index 4a6ed561233..d9b802b38fd 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -16,7 +16,7 @@ use ascii::AsciiCast;
 use c_str::{CString, ToCStr};
 use clone::Clone;
 use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
-use collections::Collection;
+use collections::{Collection, MutableSeq};
 use from_str::FromStr;
 use hash;
 use io::Writer;