Skip to content

Commit 6e1879e

Browse files
committed
Adjustments from review
1 parent e91d810 commit 6e1879e

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/libcollections/slice.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ pub trait CloneSliceExt<T> for Sized? {
831831
/// assert_eq!(Some(vec![1i, 3, 2]), perms.next());
832832
/// assert_eq!(Some(vec![3i, 1, 2]), perms.next());
833833
/// ```
834-
#[stable]
834+
#[unstable]
835835
fn permutations(&self) -> Permutations<T>;
836836

837837
/// Copies as many elements from `src` as it can into `self` (the
@@ -950,7 +950,7 @@ pub trait OrdSliceExt<T> for Sized? {
950950
/// let b: &mut [_] = &mut [1i, 0, 2];
951951
/// assert!(v == b);
952952
/// ```
953-
#[stable]
953+
#[unstable = "uncertain if this merits inclusion in std"]
954954
fn next_permutation(&mut self) -> bool;
955955

956956
/// Mutates the slice to the previous lexicographic permutation.
@@ -969,7 +969,7 @@ pub trait OrdSliceExt<T> for Sized? {
969969
/// let b: &mut [_] = &mut [0i, 1, 2];
970970
/// assert!(v == b);
971971
/// ```
972-
#[stable]
972+
#[unstable = "uncertain if this merits inclusion in std"]
973973
fn prev_permutation(&mut self) -> bool;
974974
}
975975

@@ -1165,7 +1165,7 @@ impl Iterator<(uint, uint)> for ElementSwaps {
11651165
/// swap applied.
11661166
///
11671167
/// Generates even and odd permutations alternately.
1168-
#[stable]
1168+
#[unstable]
11691169
pub struct Permutations<T> {
11701170
swaps: ElementSwaps,
11711171
v: Vec<T>,

src/libcollections/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl<T> Vec<T> {
261261
/// owned by the returned `Vec<T>`. The elements of the buffer are copied into the vector
262262
/// without cloning, as if `ptr::read()` were called on them.
263263
#[inline]
264-
#[stable]
264+
#[unstable = "may be better expressed via composition"]
265265
pub unsafe fn from_raw_buf(ptr: *const T, elts: uint) -> Vec<T> {
266266
let mut dst = Vec::with_capacity(elts);
267267
dst.set_len(elts);

src/libcore/iter.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,14 @@ pub trait IteratorExt<A>: Iterator<A> {
691691
impl<A, I> IteratorExt<A> for I where I: Iterator<A> {}
692692

693693
/// Extention trait for iterators of pairs.
694+
#[unstable = "newly added trait, likely to be merged with IteratorExt"]
694695
pub trait IteratorPairExt<A, B>: Iterator<(A, B)> {
695696
/// Converts an iterator of pairs into a pair of containers.
696697
///
697698
/// Loops through the entire iterator, collecting the first component of
698699
/// each item into one new container, and the second component into another.
699700
fn unzip<FromA, FromB>(mut self) -> (FromA, FromB) where
700-
FromA: FromIterator<A> + Extend<A>, FromB: FromIterator<B> + Extend<B>
701+
FromA: Default + Extend<A>, FromB: Default + Extend<B>
701702
{
702703
struct SizeHint<A>(uint, Option<uint>);
703704
impl<A> Iterator<A> for SizeHint<A> {
@@ -708,8 +709,11 @@ pub trait IteratorPairExt<A, B>: Iterator<(A, B)> {
708709
}
709710

710711
let (lo, hi) = self.size_hint();
711-
let mut ts: FromA = FromIterator::from_iter(SizeHint(lo, hi));
712-
let mut us: FromB = FromIterator::from_iter(SizeHint(lo, hi));
712+
let mut ts: FromA = Default::default();
713+
let mut us: FromB = Default::default();
714+
715+
ts.extend(SizeHint(lo, hi));
716+
us.extend(SizeHint(lo, hi));
713717

714718
for (t, u) in self {
715719
ts.extend(Some(t).into_iter());

0 commit comments

Comments
 (0)