Skip to content

Commit 704f93f

Browse files
committed
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`
2 parents f84b729 + 2d60691 commit 704f93f

File tree

12 files changed

+30
-30
lines changed

12 files changed

+30
-30
lines changed

src/etc/vim/syntax/rust.vim

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
9292
syn keyword rustTrait Str StrVector StrSlice OwnedStr
9393
syn keyword rustTrait IterBytes
9494
syn keyword rustTrait ToStr IntoStr
95-
syn keyword rustTrait CopyableTuple ImmutableTuple
95+
syn keyword rustTrait CloneableTuple ImmutableTuple
9696
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
9797
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
9898
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
9999
syn keyword rustTrait ImmutableTuple1 ImmutableTuple2 ImmutableTuple3 ImmutableTuple4
100100
syn keyword rustTrait ImmutableTuple5 ImmutableTuple6 ImmutableTuple7 ImmutableTuple8
101101
syn keyword rustTrait ImmutableTuple9 ImmutableTuple10 ImmutableTuple11 ImmutableTuple12
102-
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCopyableVector
103-
syn keyword rustTrait OwnedVector OwnedCopyableVector OwnedEqVector MutableVector
104-
syn keyword rustTrait Vector VectorVector CopyableVector ImmutableVector
102+
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCloneableVector
103+
syn keyword rustTrait OwnedVector OwnedCloneableVector OwnedEqVector MutableVector
104+
syn keyword rustTrait Vector VectorVector CloneableVector ImmutableVector
105105

106106
"syn keyword rustFunction stream
107107
syn keyword rustTrait Port Chan GenericChan GenericSmartChan GenericPort Peekable

src/libstd/c_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ use ptr::RawPtr;
7272
use ptr;
7373
use str::StrSlice;
7474
use str;
75-
use vec::{CopyableVector, ImmutableVector, MutableVector};
75+
use vec::{CloneableVector, ImmutableVector, MutableVector};
7676
use vec;
7777
use unstable::intrinsics;
7878

src/libstd/io/comm_adapters.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use cmp;
1515
use io;
1616
use option::{None, Option, Some};
1717
use super::{Reader, Writer};
18-
use vec::{bytes, CopyableVector, MutableVector, ImmutableVector};
18+
use vec::{bytes, CloneableVector, MutableVector, ImmutableVector};
1919

2020
/// Allows reading from a port.
2121
///

src/libstd/io/mem.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use option::{Option, Some, None};
1717
use super::{Reader, Writer, Seek, Buffer, IoError, SeekStyle, io_error,
1818
OtherIoError};
1919
use vec;
20-
use vec::{Vector, ImmutableVector, MutableVector, OwnedCopyableVector};
20+
use vec::{Vector, ImmutableVector, MutableVector, OwnedCloneableVector};
2121

2222
/// Writes to an owned, growable byte vector
2323
///

src/libstd/io/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ use str::{StrSlice, OwnedStr};
302302
use to_str::ToStr;
303303
use uint;
304304
use unstable::finally::Finally;
305-
use vec::{OwnedVector, MutableVector, ImmutableVector, OwnedCopyableVector};
305+
use vec::{OwnedVector, MutableVector, ImmutableVector, OwnedCloneableVector};
306306
use vec;
307307

308308
// Reexports

src/libstd/num/strconv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use option::{None, Option, Some};
1818
use char;
1919
use str::{StrSlice};
2020
use str;
21-
use vec::{CopyableVector, ImmutableVector, MutableVector};
21+
use vec::{CloneableVector, ImmutableVector, MutableVector};
2222
use vec::OwnedVector;
2323
use num;
2424
use num::{NumCast, Zero, One, cast, Integer};

src/libstd/path/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ use str;
7373
use str::{OwnedStr, Str, StrSlice};
7474
use to_str::ToStr;
7575
use vec;
76-
use vec::{CopyableVector, OwnedCopyableVector, OwnedVector, Vector};
76+
use vec::{CloneableVector, OwnedCloneableVector, OwnedVector, Vector};
7777
use vec::{ImmutableEqVector, ImmutableVector};
7878

7979
/// Typedef for POSIX file paths.

src/libstd/path/posix.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use str;
2121
use str::Str;
2222
use to_bytes::IterBytes;
2323
use vec;
24-
use vec::{CopyableVector, RevSplits, Splits, Vector, VectorVector,
25-
ImmutableEqVector, OwnedVector, ImmutableVector, OwnedCopyableVector};
24+
use vec::{CloneableVector, RevSplits, Splits, Vector, VectorVector,
25+
ImmutableEqVector, OwnedVector, ImmutableVector, OwnedCloneableVector};
2626
use super::{BytesContainer, GenericPath, GenericPathUnsafe};
2727

2828
/// Iterator that yields successive components of a Path as &[u8]
@@ -332,7 +332,7 @@ impl Path {
332332

333333
/// Returns a normalized byte vector representation of a path, by removing all empty
334334
/// components, and unnecessary . and .. components.
335-
fn normalize<V: Vector<u8>+CopyableVector<u8>>(v: V) -> ~[u8] {
335+
fn normalize<V: Vector<u8>+CloneableVector<u8>>(v: V) -> ~[u8] {
336336
// borrowck is being very picky
337337
let val = {
338338
let is_abs = !v.as_slice().is_empty() && v.as_slice()[0] == SEP_BYTE;

src/libstd/prelude.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr};
6868
pub use str::{Str, StrVector, StrSlice, OwnedStr};
6969
pub use to_bytes::IterBytes;
7070
pub use to_str::{ToStr, IntoStr};
71-
pub use tuple::{CopyableTuple, ImmutableTuple};
71+
pub use tuple::{CloneableTuple, ImmutableTuple};
7272
pub use tuple::{ImmutableTuple1, ImmutableTuple2, ImmutableTuple3, ImmutableTuple4};
7373
pub use tuple::{ImmutableTuple5, ImmutableTuple6, ImmutableTuple7, ImmutableTuple8};
7474
pub use tuple::{ImmutableTuple9, ImmutableTuple10, ImmutableTuple11, ImmutableTuple12};
7575
pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
7676
pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
7777
pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};
78-
pub use vec::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCopyableVector};
79-
pub use vec::{OwnedVector, OwnedCopyableVector,OwnedEqVector};
78+
pub use vec::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCloneableVector};
79+
pub use vec::{OwnedVector, OwnedCloneableVector,OwnedEqVector};
8080
pub use vec::{MutableVector, MutableTotalOrdVector};
81-
pub use vec::{Vector, VectorVector, CopyableVector, ImmutableVector};
81+
pub use vec::{Vector, VectorVector, CloneableVector, ImmutableVector};
8282

8383
// Reexported runtime types
8484
pub use comm::{Port, Chan, SharedChan};

src/libstd/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ use to_str::ToStr;
112112
use from_str::FromStr;
113113
use uint;
114114
use vec;
115-
use vec::{OwnedVector, OwnedCopyableVector, ImmutableVector, MutableVector};
115+
use vec::{OwnedVector, OwnedCloneableVector, ImmutableVector, MutableVector};
116116
use default::Default;
117117
use send_str::{SendStr, SendStrOwned};
118118
use unstable::raw::Repr;
@@ -594,7 +594,7 @@ impl<'a> Iterator<&'a str> for StrSplits<'a> {
594594
// Helper functions used for Unicode normalization
595595
fn canonical_sort(comb: &mut [(char, u8)]) {
596596
use iter::range;
597-
use tuple::CopyableTuple;
597+
use tuple::CloneableTuple;
598598

599599
let len = comb.len();
600600
for i in range(0, len) {

src/libstd/tuple.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use clone::Clone;
1717
#[cfg(not(test))] use default::Default;
1818

1919
/// Method extensions to pairs where both types satisfy the `Clone` bound
20-
pub trait CopyableTuple<T, U> {
20+
pub trait CloneableTuple<T, U> {
2121
/// Return the first element of self
2222
fn first(&self) -> T;
2323
/// Return the second element of self
@@ -26,7 +26,7 @@ pub trait CopyableTuple<T, U> {
2626
fn swap(&self) -> (U, T);
2727
}
2828

29-
impl<T:Clone,U:Clone> CopyableTuple<T, U> for (T, U) {
29+
impl<T:Clone,U:Clone> CloneableTuple<T, U> for (T, U) {
3030
/// Return the first element of self
3131
#[inline]
3232
fn first(&self) -> T {

src/libstd/vec.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,8 @@ impl<T> Container for ~[T] {
798798
}
799799
}
800800

801-
/// Extension methods for vector slices with copyable elements
802-
pub trait CopyableVector<T> {
801+
/// Extension methods for vector slices with cloneable elements
802+
pub trait CloneableVector<T> {
803803
/// Copy `self` into a new owned vector
804804
fn to_owned(&self) -> ~[T];
805805

@@ -808,7 +808,7 @@ pub trait CopyableVector<T> {
808808
}
809809

810810
/// Extension methods for vector slices
811-
impl<'a, T: Clone> CopyableVector<T> for &'a [T] {
811+
impl<'a, T: Clone> CloneableVector<T> for &'a [T] {
812812
/// Returns a copy of `v`.
813813
#[inline]
814814
fn to_owned(&self) -> ~[T] {
@@ -824,7 +824,7 @@ impl<'a, T: Clone> CopyableVector<T> for &'a [T] {
824824
}
825825

826826
/// Extension methods for owned vectors
827-
impl<T: Clone> CopyableVector<T> for ~[T] {
827+
impl<T: Clone> CloneableVector<T> for ~[T] {
828828
#[inline]
829829
fn to_owned(&self) -> ~[T] { self.clone() }
830830

@@ -833,7 +833,7 @@ impl<T: Clone> CopyableVector<T> for ~[T] {
833833
}
834834

835835
/// Extension methods for managed vectors
836-
impl<T: Clone> CopyableVector<T> for @[T] {
836+
impl<T: Clone> CloneableVector<T> for @[T] {
837837
#[inline]
838838
fn to_owned(&self) -> ~[T] { self.as_slice().to_owned() }
839839

@@ -1261,7 +1261,7 @@ impl<'a, T: TotalOrd> ImmutableTotalOrdVector<T> for &'a [T] {
12611261
}
12621262

12631263
/// Extension methods for vectors containing `Clone` elements.
1264-
pub trait ImmutableCopyableVector<T> {
1264+
pub trait ImmutableCloneableVector<T> {
12651265
/**
12661266
* Partitions the vector into those that satisfies the predicate, and
12671267
* those that do not.
@@ -1273,7 +1273,7 @@ pub trait ImmutableCopyableVector<T> {
12731273
fn permutations(self) -> Permutations<T>;
12741274
}
12751275

1276-
impl<'a,T:Clone> ImmutableCopyableVector<T> for &'a [T] {
1276+
impl<'a,T:Clone> ImmutableCloneableVector<T> for &'a [T] {
12771277
#[inline]
12781278
fn partitioned(&self, f: |&T| -> bool) -> (~[T], ~[T]) {
12791279
let mut lefts = ~[];
@@ -1698,7 +1698,7 @@ impl<T> Mutable for ~[T] {
16981698
}
16991699

17001700
/// Extension methods for owned vectors containing `Clone` elements.
1701-
pub trait OwnedCopyableVector<T:Clone> {
1701+
pub trait OwnedCloneableVector<T:Clone> {
17021702
/// Iterates over the slice `rhs`, copies each element, and then appends it to
17031703
/// the vector provided `v`. The `rhs` vector is traversed in-order.
17041704
///
@@ -1732,7 +1732,7 @@ pub trait OwnedCopyableVector<T:Clone> {
17321732
fn grow_set(&mut self, index: uint, initval: &T, val: T);
17331733
}
17341734

1735-
impl<T:Clone> OwnedCopyableVector<T> for ~[T] {
1735+
impl<T:Clone> OwnedCloneableVector<T> for ~[T] {
17361736
#[inline]
17371737
fn push_all(&mut self, rhs: &[T]) {
17381738
let new_len = self.len() + rhs.len();

0 commit comments

Comments
 (0)