Skip to content

Commit 2b67d8b

Browse files
committed
---
yaml --- r: 64777 b: refs/heads/snap-stage3 c: d7c9bb4 h: refs/heads/master i: 64775: b41bf07 v: v3
1 parent fa7a43c commit 2b67d8b

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d6bc438bbcb9240d0303ffec81bf1a617f0903a5
4+
refs/heads/snap-stage3: d7c9bb4b688ff20a3fd1d4ff1a11bb4dcbdc2c47
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)