aboutsummaryrefslogtreecommitdiff
path: root/src/camel.rs
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-12-22 18:16:03 -0800
committerHaibo Huang <hhb@google.com>2020-12-22 18:16:03 -0800
commit79ec7f1ff9ee4c3b2fb55cfebe56434a7dd949fb (patch)
treeaeaf1c535c28d84c77e7a08bb06ee9064206009b /src/camel.rs
parentce0b44810903a710fa51d10c76c7ff9d29efe6fb (diff)
downloadheck-79ec7f1ff9ee4c3b2fb55cfebe56434a7dd949fb.tar.gz
Upgrade rust/crates/heck to 0.3.2
Test: make Change-Id: Id659f4bce25cd296ce8bc27c633db12b47da1f6f
Diffstat (limited to 'src/camel.rs')
-rw-r--r--src/camel.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/camel.rs b/src/camel.rs
index 74bd741..fa31f0c 100644
--- a/src/camel.rs
+++ b/src/camel.rs
@@ -1,3 +1,5 @@
+use crate::{capitalize, transform};
+
/// This trait defines a camel case conversion.
///
/// In CamelCase, word boundaries are indicated by capital letters, including
@@ -6,14 +8,10 @@
/// ## Example:
///
/// ```rust
-/// extern crate heck;
-/// fn main() {
-///
-/// use heck::CamelCase;
+/// use heck::CamelCase;
///
-/// let sentence = "We are not in the least afraid of ruins.";
-/// assert_eq!(sentence.to_camel_case(), "WeAreNotInTheLeastAfraidOfRuins");
-/// }
+/// let sentence = "We are not in the least afraid of ruins.";
+/// assert_eq!(sentence.to_camel_case(), "WeAreNotInTheLeastAfraidOfRuins");
/// ```
pub trait CamelCase: ToOwned {
/// Convert this type to camel case.
@@ -22,7 +20,7 @@ pub trait CamelCase: ToOwned {
impl CamelCase for str {
fn to_camel_case(&self) -> String {
- ::transform(self, ::capitalize, |_| {})
+ transform(self, capitalize, |_| {})
}
}