+use crate::{capitalize, transform};
+
/// This trait defines a title case conversion.
///
/// In Title Case, word boundaries are indicated by spaces, and every word is
/// ## 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.
impl TitleCase for str {
fn to_title_case(&self) -> String {
- ::transform(self, ::capitalize, |s| s.push(' '))
+ transform(self, capitalize, |s| s.push(' '))
}
}