pub trait CamelCase: ToOwned {
// Required method
fn to_camel_case(&self) -> Self::Owned;
}
Expand description
This trait defines a camel case conversion.
In CamelCase, word boundaries are indicated by capital letters, including the first word.
§Example:
extern crate heck;
fn main() {
use heck::CamelCase;
let sentence = "We are not in the least afraid of ruins.";
assert_eq!(sentence.to_camel_case(), "WeAreNotInTheLeastAfraidOfRuins");
}
Required Methods§
Sourcefn to_camel_case(&self) -> Self::Owned
fn to_camel_case(&self) -> Self::Owned
Convert this type to camel case.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.