X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibcollections%2Fstr.rs;h=c0482702ccdb66c1a6ee149ebaa0811d7a66808b;hb=7975fd9cee750f26f9f6ef85b92a20b24ee24120;hp=69403ccd88be8b874770dd75c374c5f405f217fb;hpb=78e841d8b10e05b5bbad4b02a9d5f0e9611100c7;p=rust.git diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 69403ccd88b..c0482702ccd 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -50,6 +50,7 @@ //! is the same as `&[u8]`. #![doc(primitive = "str")] +#![stable] use self::RecompositionState::*; use self::DecompositionType::*; @@ -59,7 +60,6 @@ use core::clone::Clone; use core::iter::AdditiveIterator; use core::iter::{range, Iterator, IteratorExt}; -use core::kinds::Sized; use core::ops; use core::option::Option::{self, Some, None}; use core::slice::AsSlice; @@ -165,6 +165,7 @@ enum DecompositionType { /// External iterator for a string's decomposition's characters. /// Use with the `std::iter` module. #[derive(Clone)] +#[unstable] pub struct Decompositions<'a> { kind: DecompositionType, iter: Chars<'a>, @@ -172,6 +173,7 @@ pub struct Decompositions<'a> { sorted: bool } +#[stable] impl<'a> Iterator for Decompositions<'a> { type Item = char; @@ -253,6 +255,7 @@ enum RecompositionState { /// External iterator for a string's recomposition's characters. /// Use with the `std::iter` module. #[derive(Clone)] +#[unstable] pub struct Recompositions<'a> { iter: Decompositions<'a>, state: RecompositionState, @@ -261,6 +264,7 @@ pub struct Recompositions<'a> { last_ccc: Option } +#[stable] impl<'a> Iterator for Recompositions<'a> { type Item = char; @@ -348,10 +352,12 @@ fn next(&mut self) -> Option { /// External iterator for a string's UTF16 codeunits. /// Use with the `std::iter` module. #[derive(Clone)] +#[unstable] pub struct Utf16Units<'a> { encoder: Utf16Encoder> } +#[stable] impl<'a> Iterator for Utf16Units<'a> { type Item = u16; @@ -401,7 +407,8 @@ fn to_owned(&self) -> String { */ /// Any string that can be represented as a slice. -pub trait StrExt for Sized?: ops::Slice { +#[stable] +pub trait StrExt: ops::Slice { /// Escapes each char in `s` with `char::escape_default`. #[unstable = "return type may change to be an iterator"] fn escape_default(&self) -> String { @@ -1340,6 +1347,7 @@ fn trim_right(&self) -> &str { } } +#[stable] impl StrExt for str {} #[cfg(test)]