Skip to content

Commit

Permalink
Rollup merge of rust-lang#80193 - zseri:stabilize-osstring-ascii, r=m…
Browse files Browse the repository at this point in the history
…-ou-se

stabilize `feature(osstring_ascii)`

This PR stabilizes `feature(osstring_ascii)`.

Fixes rust-lang#70516.
  • Loading branch information
Dylan-DPC authored Mar 21, 2021
2 parents f826641 + 0acdada commit ff39c34
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions library/std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,6 @@ impl OsStr {
/// # Examples
///
/// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString;
///
/// let mut s = OsString::from("GRÜßE, JÜRGEN ❤");
Expand All @@ -725,7 +724,7 @@ impl OsStr {
///
/// 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()
Expand All @@ -742,7 +741,6 @@ impl OsStr {
/// # Examples
///
/// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString;
///
/// let mut s = OsString::from("Grüße, Jürgen ❤");
Expand All @@ -751,7 +749,7 @@ impl OsStr {
///
/// 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()
Expand All @@ -768,13 +766,12 @@ impl OsStr {
/// # 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())
}
Expand All @@ -790,13 +787,12 @@ impl OsStr {
/// # 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())
}
Expand All @@ -806,7 +802,6 @@ impl OsStr {
/// # Examples
///
/// ```
/// #![feature(osstring_ascii)]
/// use std::ffi::OsString;
///
/// let ascii = OsString::from("hello!\n");
Expand All @@ -815,7 +810,7 @@ impl OsStr {
/// 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()
Expand All @@ -829,14 +824,13 @@ impl OsStr {
/// # 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)
}
Expand Down

0 comments on commit ff39c34

Please sign in to comment.