diff options
| author | bors <bors@rust-lang.org> | 2014-01-29 17:01:39 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-29 17:01:39 -0800 |
| commit | 704f93ff5e8a8079af4a16fe984fb9f84b347d11 (patch) | |
| tree | c643c4ffb3c18a66be6181a2dbd6b795f9d36476 /src/libstd | |
| parent | f84b7291e7606b35e800070bd826e4c2e2154228 (diff) | |
| parent | 2d60691eb7a7d2735837cadf05883b3abfcbc160 (diff) | |
| download | rust-704f93ff5e8a8079af4a16fe984fb9f84b347d11.tar.gz rust-704f93ff5e8a8079af4a16fe984fb9f84b347d11.zip | |
auto merge of #11893 : Armavica/rust/copyable-cloneable, r=huonw
I found awkward to have `MutableCloneableVector` and `CloneableIterator` on the one hand, and `CopyableVector` etc. on the other hand. The concerned traits are: * `CopyableVector` --> `CloneableVector` * `OwnedCopyableVector` --> `OwnedCloneableVector` * `ImmutableCopyableVector` --> `ImmutableCloneableVector` * `CopyableTuple` --> `CloneableTuple`
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/c_str.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/comm_adapters.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/mem.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/num/strconv.rs | 2 | ||||
| -rw-r--r-- | src/libstd/path/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/path/posix.rs | 6 | ||||
| -rw-r--r-- | src/libstd/prelude.rs | 8 | ||||
| -rw-r--r-- | src/libstd/str.rs | 4 | ||||
| -rw-r--r-- | src/libstd/tuple.rs | 4 | ||||
| -rw-r--r-- | src/libstd/vec.rs | 18 |
11 files changed, 26 insertions, 26 deletions
diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs index 22e93e58194..6e6aa9ad3fa 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -72,7 +72,7 @@ use ptr::RawPtr; use ptr; use str::StrSlice; use str; -use vec::{CopyableVector, ImmutableVector, MutableVector}; +use vec::{CloneableVector, ImmutableVector, MutableVector}; use vec; use unstable::intrinsics; diff --git a/src/libstd/io/comm_adapters.rs b/src/libstd/io/comm_adapters.rs index 0acfa71e315..1eaa752d2a3 100644 --- a/src/libstd/io/comm_adapters.rs +++ b/src/libstd/io/comm_adapters.rs @@ -15,7 +15,7 @@ use cmp; use io; use option::{None, Option, Some}; use super::{Reader, Writer}; -use vec::{bytes, CopyableVector, MutableVector, ImmutableVector}; +use vec::{bytes, CloneableVector, MutableVector, ImmutableVector}; /// Allows reading from a port. /// diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs index 6c380be343c..c185951feca 100644 --- a/src/libstd/io/mem.rs +++ b/src/libstd/io/mem.rs @@ -17,7 +17,7 @@ use option::{Option, Some, None}; use super::{Reader, Writer, Seek, Buffer, IoError, SeekStyle, io_error, OtherIoError}; use vec; -use vec::{Vector, ImmutableVector, MutableVector, OwnedCopyableVector}; +use vec::{Vector, ImmutableVector, MutableVector, OwnedCloneableVector}; /// Writes to an owned, growable byte vector /// diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 8531edeb2c6..cadcbdd51f5 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -302,7 +302,7 @@ use str::{StrSlice, OwnedStr}; use to_str::ToStr; use uint; use unstable::finally::Finally; -use vec::{OwnedVector, MutableVector, ImmutableVector, OwnedCopyableVector}; +use vec::{OwnedVector, MutableVector, ImmutableVector, OwnedCloneableVector}; use vec; // Reexports diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 30abe86866e..67f6d006b57 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -18,7 +18,7 @@ use option::{None, Option, Some}; use char; use str::{StrSlice}; use str; -use vec::{CopyableVector, ImmutableVector, MutableVector}; +use vec::{CloneableVector, ImmutableVector, MutableVector}; use vec::OwnedVector; use num; use num::{NumCast, Zero, One, cast, Integer}; diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index 6464d6021ee..11f23b22c51 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -73,7 +73,7 @@ use str; use str::{OwnedStr, Str, StrSlice}; use to_str::ToStr; use vec; -use vec::{CopyableVector, OwnedCopyableVector, OwnedVector, Vector}; +use vec::{CloneableVector, OwnedCloneableVector, OwnedVector, Vector}; use vec::{ImmutableEqVector, ImmutableVector}; /// Typedef for POSIX file paths. diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index 8029ec696f8..707ba18378a 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -21,8 +21,8 @@ use str; use str::Str; use to_bytes::IterBytes; use vec; -use vec::{CopyableVector, RevSplits, Splits, Vector, VectorVector, - ImmutableEqVector, OwnedVector, ImmutableVector, OwnedCopyableVector}; +use vec::{CloneableVector, RevSplits, Splits, Vector, VectorVector, + ImmutableEqVector, OwnedVector, ImmutableVector, OwnedCloneableVector}; use super::{BytesContainer, GenericPath, GenericPathUnsafe}; /// Iterator that yields successive components of a Path as &[u8] @@ -332,7 +332,7 @@ impl Path { /// Returns a normalized byte vector representation of a path, by removing all empty /// components, and unnecessary . and .. components. - fn normalize<V: Vector<u8>+CopyableVector<u8>>(v: V) -> ~[u8] { + fn normalize<V: Vector<u8>+CloneableVector<u8>>(v: V) -> ~[u8] { // borrowck is being very picky let val = { let is_abs = !v.as_slice().is_empty() && v.as_slice()[0] == SEP_BYTE; diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index 2f5f3e8f456..c71dde3a101 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -68,17 +68,17 @@ pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr}; pub use str::{Str, StrVector, StrSlice, OwnedStr}; pub use to_bytes::IterBytes; pub use to_str::{ToStr, IntoStr}; -pub use tuple::{CopyableTuple, ImmutableTuple}; +pub use tuple::{CloneableTuple, ImmutableTuple}; pub use tuple::{ImmutableTuple1, ImmutableTuple2, ImmutableTuple3, ImmutableTuple4}; pub use tuple::{ImmutableTuple5, ImmutableTuple6, ImmutableTuple7, ImmutableTuple8}; pub use tuple::{ImmutableTuple9, ImmutableTuple10, ImmutableTuple11, ImmutableTuple12}; pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4}; pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8}; pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12}; -pub use vec::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCopyableVector}; -pub use vec::{OwnedVector, OwnedCopyableVector,OwnedEqVector}; +pub use vec::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCloneableVector}; +pub use vec::{OwnedVector, OwnedCloneableVector,OwnedEqVector}; pub use vec::{MutableVector, MutableTotalOrdVector}; -pub use vec::{Vector, VectorVector, CopyableVector, ImmutableVector}; +pub use vec::{Vector, VectorVector, CloneableVector, ImmutableVector}; // Reexported runtime types pub use comm::{Port, Chan, SharedChan}; diff --git a/src/libstd/str.rs b/src/libstd/str.rs index c7626105f51..9cc9799d0c0 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -112,7 +112,7 @@ use to_str::ToStr; use from_str::FromStr; use uint; use vec; -use vec::{OwnedVector, OwnedCopyableVector, ImmutableVector, MutableVector}; +use vec::{OwnedVector, OwnedCloneableVector, ImmutableVector, MutableVector}; use default::Default; use send_str::{SendStr, SendStrOwned}; use unstable::raw::Repr; @@ -594,7 +594,7 @@ impl<'a> Iterator<&'a str> for StrSplits<'a> { // Helper functions used for Unicode normalization fn canonical_sort(comb: &mut [(char, u8)]) { use iter::range; - use tuple::CopyableTuple; + use tuple::CloneableTuple; let len = comb.len(); for i in range(0, len) { diff --git a/src/libstd/tuple.rs b/src/libstd/tuple.rs index 8e278aeb2ea..33d23df242c 100644 --- a/src/libstd/tuple.rs +++ b/src/libstd/tuple.rs @@ -17,7 +17,7 @@ use clone::Clone; #[cfg(not(test))] use default::Default; /// Method extensions to pairs where both types satisfy the `Clone` bound -pub trait CopyableTuple<T, U> { +pub trait CloneableTuple<T, U> { /// Return the first element of self fn first(&self) -> T; /// Return the second element of self @@ -26,7 +26,7 @@ pub trait CopyableTuple<T, U> { fn swap(&self) -> (U, T); } -impl<T:Clone,U:Clone> CopyableTuple<T, U> for (T, U) { +impl<T:Clone,U:Clone> CloneableTuple<T, U> for (T, U) { /// Return the first element of self #[inline] fn first(&self) -> T { diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 3cc05ee8228..467bcf075f6 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -798,8 +798,8 @@ impl<T> Container for ~[T] { } } -/// Extension methods for vector slices with copyable elements -pub trait CopyableVector<T> { +/// Extension methods for vector slices with cloneable elements +pub trait CloneableVector<T> { /// Copy `self` into a new owned vector fn to_owned(&self) -> ~[T]; @@ -808,7 +808,7 @@ pub trait CopyableVector<T> { } /// Extension methods for vector slices -impl<'a, T: Clone> CopyableVector<T> for &'a [T] { +impl<'a, T: Clone> CloneableVector<T> for &'a [T] { /// Returns a copy of `v`. #[inline] fn to_owned(&self) -> ~[T] { @@ -824,7 +824,7 @@ impl<'a, T: Clone> CopyableVector<T> for &'a [T] { } /// Extension methods for owned vectors -impl<T: Clone> CopyableVector<T> for ~[T] { +impl<T: Clone> CloneableVector<T> for ~[T] { #[inline] fn to_owned(&self) -> ~[T] { self.clone() } @@ -833,7 +833,7 @@ impl<T: Clone> CopyableVector<T> for ~[T] { } /// Extension methods for managed vectors -impl<T: Clone> CopyableVector<T> for @[T] { +impl<T: Clone> CloneableVector<T> for @[T] { #[inline] fn to_owned(&self) -> ~[T] { self.as_slice().to_owned() } @@ -1261,7 +1261,7 @@ impl<'a, T: TotalOrd> ImmutableTotalOrdVector<T> for &'a [T] { } /// Extension methods for vectors containing `Clone` elements. -pub trait ImmutableCopyableVector<T> { +pub trait ImmutableCloneableVector<T> { /** * Partitions the vector into those that satisfies the predicate, and * those that do not. @@ -1273,7 +1273,7 @@ pub trait ImmutableCopyableVector<T> { fn permutations(self) -> Permutations<T>; } -impl<'a,T:Clone> ImmutableCopyableVector<T> for &'a [T] { +impl<'a,T:Clone> ImmutableCloneableVector<T> for &'a [T] { #[inline] fn partitioned(&self, f: |&T| -> bool) -> (~[T], ~[T]) { let mut lefts = ~[]; @@ -1698,7 +1698,7 @@ impl<T> Mutable for ~[T] { } /// Extension methods for owned vectors containing `Clone` elements. -pub trait OwnedCopyableVector<T:Clone> { +pub trait OwnedCloneableVector<T:Clone> { /// Iterates over the slice `rhs`, copies each element, and then appends it to /// the vector provided `v`. The `rhs` vector is traversed in-order. /// @@ -1732,7 +1732,7 @@ pub trait OwnedCopyableVector<T:Clone> { fn grow_set(&mut self, index: uint, initval: &T, val: T); } -impl<T:Clone> OwnedCopyableVector<T> for ~[T] { +impl<T:Clone> OwnedCloneableVector<T> for ~[T] { #[inline] fn push_all(&mut self, rhs: &[T]) { let new_len = self.len() + rhs.len(); |
