]> git.proxmox.com Git - rustc.git/blobdiff - vendor/heck/src/kebab.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / vendor / heck / src / kebab.rs
index f81ba928830f3f119b6a48e77769f37904560831..94ac322946d788c831da356c3cca786943e84900 100644 (file)
@@ -1,3 +1,5 @@
+use crate::{lowercase, transform};
+
 /// This trait defines a kebab case conversion.
 ///
 /// In kebab-case, word boundaries are indicated by hyphens.
@@ -5,14 +7,10 @@
 /// ## 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.
@@ -21,7 +19,7 @@ pub trait KebabCase: ToOwned {
 
 impl KebabCase for str {
     fn to_kebab_case(&self) -> Self::Owned {
-        ::transform(self, ::lowercase, |s| s.push('-'))
+        transform(self, lowercase, |s| s.push('-'))
     }
 }