+use crate::{lowercase, transform};
+
/// This trait defines a kebab case conversion.
///
/// In kebab-case, word boundaries are indicated by hyphens.
/// ## Example:
///
/// ```rust
-/// extern crate heck;
-/// fn main() {
-///
-/// use heck::KebabCase;
+/// use heck::KebabCase;
///
-/// let sentence = "We are going to inherit the earth.";
-/// assert_eq!(sentence.to_kebab_case(), "we-are-going-to-inherit-the-earth");
-/// }
+/// let sentence = "We are going to inherit the earth.";
+/// assert_eq!(sentence.to_kebab_case(), "we-are-going-to-inherit-the-earth");
/// ```
pub trait KebabCase: ToOwned {
/// Convert this type to kebab case.
impl KebabCase for str {
fn to_kebab_case(&self) -> Self::Owned {
- ::transform(self, ::lowercase, |s| s.push('-'))
+ transform(self, lowercase, |s| s.push('-'))
}
}