about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTshepang Lekhonkhobe <tshepang@gmail.com>2015-06-12 23:47:54 +0200
committerTshepang Lekhonkhobe <tshepang@gmail.com>2015-06-12 23:47:54 +0200
commit7c8440eb2f4e0ab0e1689d933cba679f5d997bc4 (patch)
tree50fe53fd104b142fb034a5db4a6317a75ba288f8 /src
parent1671b9baeceeb38ddb7366668d28e3a7ee839ef3 (diff)
downloadrust-7c8440eb2f4e0ab0e1689d933cba679f5d997bc4.tar.gz
rust-7c8440eb2f4e0ab0e1689d933cba679f5d997bc4.zip
doc: add examples for to_uppercase and to_lowercase
Diffstat (limited to 'src')
-rw-r--r--src/librustc_unicode/char.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs
index 946a833b3f8..fb5913537b2 100644
--- a/src/librustc_unicode/char.rs
+++ b/src/librustc_unicode/char.rs
@@ -467,6 +467,12 @@ impl char {
     /// Returns an iterator which yields the characters corresponding to the
     /// lowercase equivalent of the character. If no conversion is possible then
     /// an iterator with just the input character is returned.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// assert_eq!(Some('c'), 'C'.to_lowercase().next());
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn to_lowercase(self) -> ToLowercase {
@@ -515,6 +521,12 @@ impl char {
     /// [`SpecialCasing.txt`]: ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt
     ///
     /// [2]: http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf#G33992
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// assert_eq!(Some('C'), 'c'.to_uppercase().next());
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn to_uppercase(self) -> ToUppercase {