Skip to content

Commit

Permalink
Stabilize split_ascii_whitespace
Browse files Browse the repository at this point in the history
Tracking issue FCP to merge: #48656 (comment)
  • Loading branch information
SimonSapin committed Feb 1, 2019
1 parent 741a3d4 commit 6a01f8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/liballoc/lib.rs
Expand Up @@ -98,7 +98,6 @@
#![feature(rustc_attrs)]
#![feature(receiver_trait)]
#![feature(specialization)]
#![feature(split_ascii_whitespace)]
#![feature(staged_api)]
#![feature(str_internals)]
#![feature(trusted_len)]
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/str.rs
Expand Up @@ -68,7 +68,7 @@ pub use core::str::SplitWhitespace;
pub use core::str::pattern;
#[stable(feature = "encode_utf16", since = "1.8.0")]
pub use core::str::EncodeUtf16;
#[unstable(feature = "split_ascii_whitespace", issue = "48656")]
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
pub use core::str::SplitAsciiWhitespace;

#[unstable(feature = "slice_concat_ext",
Expand Down
11 changes: 5 additions & 6 deletions src/libcore/str/mod.rs
Expand Up @@ -2700,7 +2700,6 @@ impl str {
/// Basic usage:
///
/// ```
/// #![feature(split_ascii_whitespace)]
/// let mut iter = "A few words".split_ascii_whitespace();
///
/// assert_eq!(Some("A"), iter.next());
Expand All @@ -2722,7 +2721,7 @@ impl str {
///
/// assert_eq!(None, iter.next());
/// ```
#[unstable(feature = "split_ascii_whitespace", issue = "48656")]
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
#[inline]
pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace {
let inner = self
Expand Down Expand Up @@ -4009,7 +4008,7 @@ pub struct SplitWhitespace<'a> {
///
/// [`split_ascii_whitespace`]: ../../std/primitive.str.html#method.split_ascii_whitespace
/// [`str`]: ../../std/primitive.str.html
#[unstable(feature = "split_ascii_whitespace", issue = "48656")]
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
#[derive(Clone, Debug)]
pub struct SplitAsciiWhitespace<'a> {
inner: Map<Filter<SliceSplit<'a, u8, IsAsciiWhitespace>, IsNotEmpty>, UnsafeBytesToStr>,
Expand Down Expand Up @@ -4134,7 +4133,7 @@ impl<'a> DoubleEndedIterator for SplitWhitespace<'a> {
#[stable(feature = "fused", since = "1.26.0")]
impl FusedIterator for SplitWhitespace<'_> {}

#[unstable(feature = "split_ascii_whitespace", issue = "48656")]
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
impl<'a> Iterator for SplitAsciiWhitespace<'a> {
type Item = &'a str;

Expand All @@ -4149,15 +4148,15 @@ impl<'a> Iterator for SplitAsciiWhitespace<'a> {
}
}

#[unstable(feature = "split_ascii_whitespace", issue = "48656")]
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
impl<'a> DoubleEndedIterator for SplitAsciiWhitespace<'a> {
#[inline]
fn next_back(&mut self) -> Option<&'a str> {
self.inner.next_back()
}
}

#[unstable(feature = "split_ascii_whitespace", issue = "48656")]
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
impl FusedIterator for SplitAsciiWhitespace<'_> {}

/// An iterator of [`u16`] over the string encoded as UTF-16.
Expand Down

0 comments on commit 6a01f8a

Please sign in to comment.