Skip to content

Commit 3f5d585

Browse files
committed
---
yaml --- r: 52175 b: refs/heads/dist-snap c: dc7183e h: refs/heads/master i: 52173: 502ba8b 52171: df6b5cb 52167: d6f0559 52159: 7977215 v: v3
1 parent 1a9244f commit 3f5d585

File tree

4 files changed

+25
-26
lines changed

4 files changed

+25
-26
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: d1b7d44b8c340deeadcdaab60316764830fee597
10+
refs/heads/dist-snap: dc7183ed0e5da6317d7b3cc3ea25ae30e1a91bcd
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
191191
pub use str::{StrSlice, Trimmable};
192192
pub use vec::{ConstVector, CopyableVector, ImmutableVector};
193193
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
194-
pub use vec::{MutableVector, MutableCopyableVector};
194+
pub use vec::{OwnedVector, OwnedCopyableVector};
195195
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
196196
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
197197

branches/dist-snap/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
2121
pub use str::{StrSlice, Trimmable};
2222
pub use vec::{ConstVector, CopyableVector, ImmutableVector};
2323
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
24-
pub use vec::{MutableVector, MutableCopyableVector};
24+
pub use vec::{OwnedVector, OwnedCopyableVector};
2525
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
2626
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
2727

branches/dist-snap/src/libcore/vec.rs

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,13 +1599,6 @@ pub trait ImmutableVector<T> {
15991599
pure fn filter_map<U: Copy>(f: fn(t: &T) -> Option<U>) -> ~[U];
16001600
}
16011601

1602-
pub trait ImmutableEqVector<T: Eq> {
1603-
pure fn position(f: fn(t: &T) -> bool) -> Option<uint>;
1604-
pure fn position_elem(t: &T) -> Option<uint>;
1605-
pure fn rposition(f: fn(t: &T) -> bool) -> Option<uint>;
1606-
pure fn rposition_elem(t: &T) -> Option<uint>;
1607-
}
1608-
16091602
/// Extension methods for vectors
16101603
impl<T> &[T]: ImmutableVector<T> {
16111604
/// Return a slice that points into another slice.
@@ -1671,6 +1664,13 @@ impl<T> &[T]: ImmutableVector<T> {
16711664
}
16721665
}
16731666

1667+
pub trait ImmutableEqVector<T: Eq> {
1668+
pure fn position(f: fn(t: &T) -> bool) -> Option<uint>;
1669+
pure fn position_elem(t: &T) -> Option<uint>;
1670+
pure fn rposition(f: fn(t: &T) -> bool) -> Option<uint>;
1671+
pure fn rposition_elem(t: &T) -> Option<uint>;
1672+
}
1673+
16741674
impl<T: Eq> &[T]: ImmutableEqVector<T> {
16751675
/**
16761676
* Find the first index matching some predicate
@@ -1740,7 +1740,7 @@ impl<T: Copy> &[T]: ImmutableCopyableVector<T> {
17401740
pure fn rfind(f: fn(t: &T) -> bool) -> Option<T> { rfind(self, f) }
17411741
}
17421742

1743-
pub trait MutableVector<T> {
1743+
pub trait OwnedVector<T> {
17441744
fn push(&mut self, t: T);
17451745
fn push_all_move(&mut self, rhs: ~[T]);
17461746
fn pop(&mut self) -> T;
@@ -1753,18 +1753,7 @@ pub trait MutableVector<T> {
17531753
fn retain(&mut self, f: pure fn(t: &T) -> bool);
17541754
}
17551755

1756-
pub trait MutableCopyableVector<T: Copy> {
1757-
fn push_all(&mut self, rhs: &[const T]);
1758-
fn grow(&mut self, n: uint, initval: &T);
1759-
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>);
1760-
fn grow_set(&mut self, index: uint, initval: &T, val: T);
1761-
}
1762-
1763-
trait MutableEqVector<T: Eq> {
1764-
fn dedup(&mut self);
1765-
}
1766-
1767-
impl<T> ~[T]: MutableVector<T> {
1756+
impl<T> ~[T]: OwnedVector<T> {
17681757
#[inline]
17691758
fn push(&mut self, t: T) {
17701759
push(self, t);
@@ -1817,7 +1806,14 @@ impl<T> ~[T]: MutableVector<T> {
18171806

18181807
}
18191808

1820-
impl<T: Copy> ~[T]: MutableCopyableVector<T> {
1809+
pub trait OwnedCopyableVector<T: Copy> {
1810+
fn push_all(&mut self, rhs: &[const T]);
1811+
fn grow(&mut self, n: uint, initval: &T);
1812+
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>);
1813+
fn grow_set(&mut self, index: uint, initval: &T, val: T);
1814+
}
1815+
1816+
impl<T: Copy> ~[T]: OwnedCopyableVector<T> {
18211817
#[inline]
18221818
fn push_all(&mut self, rhs: &[const T]) {
18231819
push_all(self, rhs);
@@ -1839,14 +1835,17 @@ impl<T: Copy> ~[T]: MutableCopyableVector<T> {
18391835
}
18401836
}
18411837

1842-
impl<T: Eq> ~[T]: MutableEqVector<T> {
1838+
trait OwnedEqVector<T: Eq> {
1839+
fn dedup(&mut self);
1840+
}
1841+
1842+
impl<T: Eq> ~[T]: OwnedEqVector<T> {
18431843
#[inline]
18441844
fn dedup(&mut self) {
18451845
dedup(self)
18461846
}
18471847
}
18481848

1849-
18501849
/**
18511850
* Constructs a vector from an unsafe pointer to a buffer
18521851
*

0 commit comments

Comments
 (0)