Skip to content

Commit

Permalink
Stabilize iterator_try_fold in 1.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Apr 2, 2018
1 parent d8c4c83 commit 9db63bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
7 changes: 2 additions & 5 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,6 @@ pub trait Iterator {
/// Basic usage:
///
/// ```
/// #![feature(iterator_try_fold)]
/// let a = [1, 2, 3];
///
/// // the checked sum of all of the elements of the array
Expand All @@ -1458,7 +1457,6 @@ pub trait Iterator {
/// Short-circuiting:
///
/// ```
/// #![feature(iterator_try_fold)]
/// let a = [10, 20, 30, 100, 40, 50];
/// let mut it = a.iter();
///
Expand All @@ -1472,7 +1470,7 @@ pub trait Iterator {
/// assert_eq!(it.next(), Some(&40));
/// ```
#[inline]
#[unstable(feature = "iterator_try_fold", issue = "45594")]
#[stable(feature = "iterator_try_fold", since = "1.27.0")]
fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R where
Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Ok=B>
{
Expand All @@ -1495,7 +1493,6 @@ pub trait Iterator {
/// # Examples
///
/// ```
/// #![feature(iterator_try_fold)]
/// use std::fs::rename;
/// use std::io::{stdout, Write};
/// use std::path::Path;
Expand All @@ -1512,7 +1509,7 @@ pub trait Iterator {
/// assert_eq!(it.next(), Some("stale_bread.json"));
/// ```
#[inline]
#[unstable(feature = "iterator_try_fold", issue = "45594")]
#[stable(feature = "iterator_try_fold", since = "1.27.0")]
fn try_for_each<F, R>(&mut self, mut f: F) -> R where
Self: Sized, F: FnMut(Self::Item) -> R, R: Try<Ok=()>
{
Expand Down
4 changes: 1 addition & 3 deletions src/libcore/iter/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ pub trait DoubleEndedIterator: Iterator {
/// Basic usage:
///
/// ```
/// #![feature(iterator_try_fold)]
/// let a = ["1", "2", "3"];
/// let sum = a.iter()
/// .map(|&s| s.parse::<i32>())
Expand All @@ -438,7 +437,6 @@ pub trait DoubleEndedIterator: Iterator {
/// Short-circuiting:
///
/// ```
/// #![feature(iterator_try_fold)]
/// let a = ["1", "rust", "3"];
/// let mut it = a.iter();
/// let sum = it
Expand All @@ -452,7 +450,7 @@ pub trait DoubleEndedIterator: Iterator {
/// assert_eq!(it.next_back(), Some(&"1"));
/// ```
#[inline]
#[unstable(feature = "iterator_try_fold", issue = "45594")]
#[stable(feature = "iterator_try_fold", since = "1.27.0")]
fn try_rfold<B, F, R>(&mut self, init: B, mut f: F) -> R where
Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Ok=B>
{
Expand Down
1 change: 0 additions & 1 deletion src/libcore/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#![feature(iterator_step_by)]
#![cfg_attr(stage0, feature(i128_type))]
#![cfg_attr(stage0, feature(inclusive_range_syntax))]
#![feature(iterator_try_fold)]
#![feature(iterator_flatten)]
#![cfg_attr(stage0, feature(conservative_impl_trait))]
#![feature(iterator_repeat_with)]
Expand Down

0 comments on commit 9db63bb

Please sign in to comment.