Rollup merge of #80193 - zseri:stabilize-osstring-ascii, r=m-ou-se

stabilize `feature(osstring_ascii)`

This PR stabilizes `feature(osstring_ascii)`.

Fixes #70516.
This commit is contained in:
Dylan DPC 2021-03-22 02:20:23 +01:00 committed by GitHub
commit e9398bcc4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -716,7 +716,6 @@ impl OsStr {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString; /// use std::ffi::OsString;
/// ///
/// let mut s = OsString::from("GRÜßE, JÜRGEN ❤"); /// let mut s = OsString::from("GRÜßE, JÜRGEN ❤");
@ -725,7 +724,7 @@ impl OsStr {
/// ///
/// assert_eq!("grÜße, jÜrgen ❤", s); /// assert_eq!("grÜße, jÜrgen ❤", s);
/// ``` /// ```
#[unstable(feature = "osstring_ascii", issue = "70516")] #[stable(feature = "osstring_ascii", since = "1.53.0")]
#[inline] #[inline]
pub fn make_ascii_lowercase(&mut self) { pub fn make_ascii_lowercase(&mut self) {
self.inner.make_ascii_lowercase() self.inner.make_ascii_lowercase()
@ -742,7 +741,6 @@ impl OsStr {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString; /// use std::ffi::OsString;
/// ///
/// let mut s = OsString::from("Grüße, Jürgen ❤"); /// let mut s = OsString::from("Grüße, Jürgen ❤");
@ -751,7 +749,7 @@ impl OsStr {
/// ///
/// assert_eq!("GRüßE, JüRGEN ❤", s); /// assert_eq!("GRüßE, JüRGEN ❤", s);
/// ``` /// ```
#[unstable(feature = "osstring_ascii", issue = "70516")] #[stable(feature = "osstring_ascii", since = "1.53.0")]
#[inline] #[inline]
pub fn make_ascii_uppercase(&mut self) { pub fn make_ascii_uppercase(&mut self) {
self.inner.make_ascii_uppercase() self.inner.make_ascii_uppercase()
@ -768,13 +766,12 @@ impl OsStr {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString; /// use std::ffi::OsString;
/// let s = OsString::from("Grüße, Jürgen ❤"); /// let s = OsString::from("Grüße, Jürgen ❤");
/// ///
/// assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase()); /// assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase());
/// ``` /// ```
#[unstable(feature = "osstring_ascii", issue = "70516")] #[stable(feature = "osstring_ascii", since = "1.53.0")]
pub fn to_ascii_lowercase(&self) -> OsString { pub fn to_ascii_lowercase(&self) -> OsString {
OsString::from_inner(self.inner.to_ascii_lowercase()) OsString::from_inner(self.inner.to_ascii_lowercase())
} }
@ -790,13 +787,12 @@ impl OsStr {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString; /// use std::ffi::OsString;
/// let s = OsString::from("Grüße, Jürgen ❤"); /// let s = OsString::from("Grüße, Jürgen ❤");
/// ///
/// assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase()); /// assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase());
/// ``` /// ```
#[unstable(feature = "osstring_ascii", issue = "70516")] #[stable(feature = "osstring_ascii", since = "1.53.0")]
pub fn to_ascii_uppercase(&self) -> OsString { pub fn to_ascii_uppercase(&self) -> OsString {
OsString::from_inner(self.inner.to_ascii_uppercase()) OsString::from_inner(self.inner.to_ascii_uppercase())
} }
@ -806,7 +802,6 @@ impl OsStr {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString; /// use std::ffi::OsString;
/// ///
/// let ascii = OsString::from("hello!\n"); /// let ascii = OsString::from("hello!\n");
@ -815,7 +810,7 @@ impl OsStr {
/// assert!(ascii.is_ascii()); /// assert!(ascii.is_ascii());
/// assert!(!non_ascii.is_ascii()); /// assert!(!non_ascii.is_ascii());
/// ``` /// ```
#[unstable(feature = "osstring_ascii", issue = "70516")] #[stable(feature = "osstring_ascii", since = "1.53.0")]
#[inline] #[inline]
pub fn is_ascii(&self) -> bool { pub fn is_ascii(&self) -> bool {
self.inner.is_ascii() self.inner.is_ascii()
@ -829,14 +824,13 @@ impl OsStr {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString; /// use std::ffi::OsString;
/// ///
/// assert!(OsString::from("Ferris").eq_ignore_ascii_case("FERRIS")); /// assert!(OsString::from("Ferris").eq_ignore_ascii_case("FERRIS"));
/// assert!(OsString::from("Ferrös").eq_ignore_ascii_case("FERRöS")); /// assert!(OsString::from("Ferrös").eq_ignore_ascii_case("FERRöS"));
/// assert!(!OsString::from("Ferrös").eq_ignore_ascii_case("FERRÖS")); /// assert!(!OsString::from("Ferrös").eq_ignore_ascii_case("FERRÖS"));
/// ``` /// ```
#[unstable(feature = "osstring_ascii", issue = "70516")] #[stable(feature = "osstring_ascii", since = "1.53.0")]
pub fn eq_ignore_ascii_case<S: AsRef<OsStr>>(&self, other: S) -> bool { pub fn eq_ignore_ascii_case<S: AsRef<OsStr>>(&self, other: S) -> bool {
self.inner.eq_ignore_ascii_case(&other.as_ref().inner) self.inner.eq_ignore_ascii_case(&other.as_ref().inner)
} }