mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-21 20:17:55 +00:00
Add examples for make_ascii_{uppercase, lowercase}
This commit is contained in:
parent
991c719a1d
commit
1b6b7597ed
@ -3971,6 +3971,16 @@ impl str {
|
||||
/// [`to_ascii_uppercase`].
|
||||
///
|
||||
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let mut s = String::from("Grüße, Jürgen ❤");
|
||||
///
|
||||
/// s.make_ascii_uppercase();
|
||||
///
|
||||
/// assert_eq!("GRüßE, JüRGEN ❤", s);
|
||||
/// ```
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
pub fn make_ascii_uppercase(&mut self) {
|
||||
let me = unsafe { self.as_bytes_mut() };
|
||||
@ -3986,6 +3996,16 @@ impl str {
|
||||
/// [`to_ascii_lowercase`].
|
||||
///
|
||||
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let mut s = String::from("Grüße, Jürgen ❤");
|
||||
///
|
||||
/// s.make_ascii_lowercase();
|
||||
///
|
||||
/// assert_eq!("grüße, jürgen ❤", s);
|
||||
/// ```
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
pub fn make_ascii_lowercase(&mut self) {
|
||||
let me = unsafe { self.as_bytes_mut() };
|
||||
|
Loading…
Reference in New Issue
Block a user