Skip to content

Commit 7c8440e

Browse files
committed
doc: add examples for to_uppercase and to_lowercase
1 parent 1671b9b commit 7c8440e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/librustc_unicode/char.rs

+12
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,12 @@ impl char {
467467
/// Returns an iterator which yields the characters corresponding to the
468468
/// lowercase equivalent of the character. If no conversion is possible then
469469
/// an iterator with just the input character is returned.
470+
///
471+
/// # Examples
472+
///
473+
/// ```
474+
/// assert_eq!(Some('c'), 'C'.to_lowercase().next());
475+
/// ```
470476
#[stable(feature = "rust1", since = "1.0.0")]
471477
#[inline]
472478
pub fn to_lowercase(self) -> ToLowercase {
@@ -515,6 +521,12 @@ impl char {
515521
/// [`SpecialCasing.txt`]: ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt
516522
///
517523
/// [2]: http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf#G33992
524+
///
525+
/// # Examples
526+
///
527+
/// ```
528+
/// assert_eq!(Some('C'), 'c'.to_uppercase().next());
529+
/// ```
518530
#[stable(feature = "rust1", since = "1.0.0")]
519531
#[inline]
520532
pub fn to_uppercase(self) -> ToUppercase {

0 commit comments

Comments
 (0)