Skip to content

Commit 0374c9c

Browse files
committed
---
yaml --- r: 143311 b: refs/heads/try2 c: d7c9bb4 h: refs/heads/master i: 143309: 3999c11 143307: 5f5ceb7 143303: a77d21c 143295: 95d2148 v: v3
1 parent 10920ff commit 0374c9c

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d6bc438bbcb9240d0303ffec81bf1a617f0903a5
8+
refs/heads/try2: d7c9bb4b688ff20a3fd1d4ff1a11bb4dcbdc2c47
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/vec.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,8 @@ impl<T:Eq> OwnedEqVector<T> for ~[T] {
16561656
#[allow(missing_doc)]
16571657
pub trait MutableVector<'self, T> {
16581658
fn mut_slice(self, start: uint, end: uint) -> &'self mut [T];
1659+
fn mut_slice_from(self, start: uint) -> &'self mut [T];
1660+
fn mut_slice_to(self, end: uint) -> &'self mut [T];
16591661
fn mut_iter(self) -> VecMutIterator<'self, T>;
16601662
fn mut_rev_iter(self) -> VecMutRevIterator<'self, T>;
16611663

@@ -1709,6 +1711,27 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
17091711
}
17101712
}
17111713

1714+
/**
1715+
* Returns a slice of self from `start` to the end of the vec.
1716+
*
1717+
* Fails when `start` points outside the bounds of self.
1718+
*/
1719+
#[inline]
1720+
fn mut_slice_from(self, start: uint) -> &'self mut [T] {
1721+
let len = self.len();
1722+
self.mut_slice(start, len)
1723+
}
1724+
1725+
/**
1726+
* Returns a slice of self from the start of the vec to `end`.
1727+
*
1728+
* Fails when `end` points outside the bounds of self.
1729+
*/
1730+
#[inline]
1731+
fn mut_slice_to(self, end: uint) -> &'self mut [T] {
1732+
self.mut_slice(0, end)
1733+
}
1734+
17121735
#[inline]
17131736
fn mut_split(self, mid: uint) -> (&'self mut [T], &'self mut [T]) {
17141737
unsafe {

0 commit comments

Comments
 (0)