Skip to content

Commit 1a9244f

Browse files
committed
---
yaml --- r: 52174 b: refs/heads/dist-snap c: d1b7d44 h: refs/heads/master v: v3
1 parent 502ba8b commit 1a9244f

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
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: 93c2ebf9944274ca9d1e97589a992ff52c04f07d
10+
refs/heads/dist-snap: d1b7d44b8c340deeadcdaab60316764830fee597
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,15 +1570,19 @@ impl<T: Copy> &[const T]: CopyableVector<T> {
15701570
/// Returns the first element of a vector
15711571
#[inline]
15721572
pure fn head() -> T { head(self) }
1573+
15731574
/// Returns all but the last elemnt of a vector
15741575
#[inline]
15751576
pure fn init() -> ~[T] { init(self) }
1577+
15761578
/// Returns the last element of a `v`, failing if the vector is empty.
15771579
#[inline]
15781580
pure fn last() -> T { last(self) }
1581+
15791582
/// Returns a copy of the elements from [`start`..`end`) from `v`.
15801583
#[inline]
15811584
pure fn slice(start: uint, end: uint) -> ~[T] { slice(self, start, end) }
1585+
15821586
/// Returns all but the first element of a vector
15831587
#[inline]
15841588
pure fn tail() -> ~[T] { tail(self) }
@@ -1605,17 +1609,21 @@ pub trait ImmutableEqVector<T: Eq> {
16051609
/// Extension methods for vectors
16061610
impl<T> &[T]: ImmutableVector<T> {
16071611
/// Return a slice that points into another slice.
1612+
#[inline]
16081613
pure fn view(start: uint, end: uint) -> &self/[T] {
16091614
view(self, start, end)
16101615
}
1616+
16111617
/// Reduce a vector from right to left
16121618
#[inline]
16131619
pure fn foldr<U: Copy>(z: U, p: fn(t: &T, u: U) -> U) -> U {
16141620
foldr(self, z, p)
16151621
}
1622+
16161623
/// Apply a function to each element of a vector and return the results
16171624
#[inline]
16181625
pure fn map<U>(f: fn(t: &T) -> U) -> ~[U] { map(self, f) }
1626+
16191627
/**
16201628
* Apply a function to the index and value of each element in the vector
16211629
* and return the results
@@ -1757,66 +1765,82 @@ trait MutableEqVector<T: Eq> {
17571765
}
17581766

17591767
impl<T> ~[T]: MutableVector<T> {
1768+
#[inline]
17601769
fn push(&mut self, t: T) {
17611770
push(self, t);
17621771
}
17631772

1773+
#[inline]
17641774
fn push_all_move(&mut self, rhs: ~[T]) {
17651775
push_all_move(self, rhs);
17661776
}
17671777

1778+
#[inline]
17681779
fn pop(&mut self) -> T {
17691780
pop(self)
17701781
}
17711782

1783+
#[inline]
17721784
fn shift(&mut self) -> T {
17731785
shift(self)
17741786
}
17751787

1788+
#[inline]
17761789
fn unshift(&mut self, x: T) {
17771790
unshift(self, x)
17781791
}
17791792

1793+
#[inline]
17801794
fn insert(&mut self, i: uint, x:T) {
17811795
insert(self, i, x)
17821796
}
17831797

1798+
#[inline]
17841799
fn remove(&mut self, i: uint) -> T {
17851800
remove(self, i)
17861801
}
17871802

1803+
#[inline]
17881804
fn swap_remove(&mut self, index: uint) -> T {
17891805
swap_remove(self, index)
17901806
}
17911807

1808+
#[inline]
17921809
fn truncate(&mut self, newlen: uint) {
17931810
truncate(self, newlen);
17941811
}
17951812

1813+
#[inline]
17961814
fn retain(&mut self, f: pure fn(t: &T) -> bool) {
17971815
retain(self, f);
17981816
}
1817+
17991818
}
18001819

18011820
impl<T: Copy> ~[T]: MutableCopyableVector<T> {
1821+
#[inline]
18021822
fn push_all(&mut self, rhs: &[const T]) {
18031823
push_all(self, rhs);
18041824
}
18051825

1826+
#[inline]
18061827
fn grow(&mut self, n: uint, initval: &T) {
18071828
grow(self, n, initval);
18081829
}
18091830

1831+
#[inline]
18101832
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>) {
18111833
grow_fn(self, n, op);
18121834
}
18131835

1836+
#[inline]
18141837
fn grow_set(&mut self, index: uint, initval: &T, val: T) {
18151838
grow_set(self, index, initval, val);
18161839
}
18171840
}
18181841

18191842
impl<T: Eq> ~[T]: MutableEqVector<T> {
1843+
#[inline]
18201844
fn dedup(&mut self) {
18211845
dedup(self)
18221846
}

0 commit comments

Comments
 (0)