]> git.proxmox.com Git - rustc.git/blobdiff - vendor/heck/src/title.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / vendor / heck / src / title.rs
index cb48302ee459cbeaddc983a1b70d6a7b65977fbc..3723f1fdc9ee7667e3422f9d9ac5581b5c3b6536 100644 (file)
@@ -1,3 +1,5 @@
+use crate::{capitalize, transform};
+
 /// This trait defines a title case conversion.
 ///
 /// In Title Case, word boundaries are indicated by spaces, and every word is
@@ -6,14 +8,10 @@
 /// ## Example:
 ///
 /// ```rust
-/// extern crate heck;
-/// fn main() {
-///     
-///     use heck::TitleCase;
+/// use heck::TitleCase;
 ///
-///     let sentence = "We have always lived in slums and holes in the wall.";
-///     assert_eq!(sentence.to_title_case(), "We Have Always Lived In Slums And Holes In The Wall");
-/// }
+/// let sentence = "We have always lived in slums and holes in the wall.";
+/// assert_eq!(sentence.to_title_case(), "We Have Always Lived In Slums And Holes In The Wall");
 /// ```
 pub trait TitleCase: ToOwned {
     /// Convert this type to title case.
@@ -22,7 +20,7 @@ pub trait TitleCase: ToOwned {
 
 impl TitleCase for str {
     fn to_title_case(&self) -> String {
-        ::transform(self, ::capitalize, |s| s.push(' '))
+        transform(self, capitalize, |s| s.push(' '))
     }
 }