1
Fork 0

Mark str::to_uppercase and str::to_lowercase as stable.

This commit is contained in:
Simon Sapin 2015-06-06 20:37:23 +02:00
parent f901086b0d
commit 7ac6b58237
2 changed files with 5 additions and 5 deletions

View file

@ -1851,7 +1851,7 @@ impl str {
/// let s = "HELLO"; /// let s = "HELLO";
/// assert_eq!(s.to_lowercase(), "hello"); /// assert_eq!(s.to_lowercase(), "hello");
/// ``` /// ```
#[unstable(feature = "collections")] #[stable(feature = "unicode_case_mapping", since = "1.2.0")]
pub fn to_lowercase(&self) -> String { pub fn to_lowercase(&self) -> String {
let mut s = String::with_capacity(self.len()); let mut s = String::with_capacity(self.len());
for (i, c) in self[..].char_indices() { for (i, c) in self[..].char_indices() {
@ -1892,7 +1892,7 @@ impl str {
/// let s = "hello"; /// let s = "hello";
/// assert_eq!(s.to_uppercase(), "HELLO"); /// assert_eq!(s.to_uppercase(), "HELLO");
/// ``` /// ```
#[unstable(feature = "collections")] #[stable(feature = "unicode_case_mapping", since = "1.2.0")]
pub fn to_uppercase(&self) -> String { pub fn to_uppercase(&self) -> String {
let mut s = String::with_capacity(self.len()); let mut s = String::with_capacity(self.len());
s.extend(self[..].chars().flat_map(|c| c.to_uppercase())); s.extend(self[..].chars().flat_map(|c| c.to_uppercase()));

View file

@ -70,10 +70,10 @@ impl Iterator for ToUppercase {
/// An iterator over the titlecase mapping of a given character, returned from /// An iterator over the titlecase mapping of a given character, returned from
/// the [`to_titlecase` method](../primitive.char.html#method.to_titlecase) on /// the [`to_titlecase` method](../primitive.char.html#method.to_titlecase) on
/// characters. /// characters.
#[stable(feature = "char_to_titlecase", since = "1.2.0")] #[stable(feature = "unicode_case_mapping", since = "1.2.0")]
pub struct ToTitlecase(CaseMappingIter); pub struct ToTitlecase(CaseMappingIter);
#[stable(feature = "char_to_titlecase", since = "1.2.0")] #[stable(feature = "unicode_case_mapping", since = "1.2.0")]
impl Iterator for ToTitlecase { impl Iterator for ToTitlecase {
type Item = char; type Item = char;
fn next(&mut self) -> Option<char> { self.0.next() } fn next(&mut self) -> Option<char> { self.0.next() }
@ -481,7 +481,7 @@ impl char {
/// Returns an iterator which yields the characters corresponding to the /// Returns an iterator which yields the characters corresponding to the
/// lowercase equivalent of the character. If no conversion is possible then /// lowercase equivalent of the character. If no conversion is possible then
/// an iterator with just the input character is returned. /// an iterator with just the input character is returned.
#[stable(feature = "char_to_titlecase", since = "1.2.0")] #[stable(feature = "unicode_case_mapping", since = "1.2.0")]
#[inline] #[inline]
pub fn to_titlecase(self) -> ToTitlecase { pub fn to_titlecase(self) -> ToTitlecase {
ToTitlecase(CaseMappingIter::new(conversions::to_title(self))) ToTitlecase(CaseMappingIter::new(conversions::to_title(self)))