From dfd9d0429cbea6133d240a37d6f4edf2a5a90a85 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 1 Jun 2019 00:23:26 -0700 Subject: [PATCH] Add an unusual-conversion example to to_uppercase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Like how to_lowercase has ὈΔΥΣΣΕΎΣ. --- src/liballoc/str.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index f66ff894ae865..0c7d2b837a39a 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -431,6 +431,13 @@ impl str { /// /// assert_eq!(new_year, new_year.to_uppercase()); /// ``` + /// + /// One character can become multiple: + /// ``` + /// let s = "tschüß"; + /// + /// assert_eq!("TSCHÜSS", s.to_uppercase()); + /// ``` #[stable(feature = "unicode_case_mapping", since = "1.2.0")] pub fn to_uppercase(&self) -> String { let mut s = String::with_capacity(self.len());