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