mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
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:
commit
e9398bcc4d
@ -716,7 +716,6 @@ impl OsStr {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(osstring_ascii)]
|
||||
/// use std::ffi::OsString;
|
||||
///
|
||||
/// let mut s = OsString::from("GRÜßE, JÜRGEN ❤");
|
||||
@ -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()
|
||||
@ -742,7 +741,6 @@ impl OsStr {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(osstring_ascii)]
|
||||
/// use std::ffi::OsString;
|
||||
///
|
||||
/// let mut s = OsString::from("Grüße, Jürgen ❤");
|
||||
@ -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()
|
||||
@ -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())
|
||||
}
|
||||
@ -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())
|
||||
}
|
||||
@ -806,7 +802,6 @@ impl OsStr {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(osstring_ascii)]
|
||||
/// use std::ffi::OsString;
|
||||
///
|
||||
/// let ascii = OsString::from("hello!\n");
|
||||
@ -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()
|
||||
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user