use alloc::{
borrow::ToOwned,
string::{String, ToString},
};
usecrate::{capitalize, transform};
/// This trait defines an upper camel case conversion. /// /// In UpperCamelCase, word boundaries are indicated by capital letters, /// including the first word. /// /// ## Example: /// /// ```rust /// use heck::ToUpperCamelCase; /// /// let sentence = "We are not in the least afraid of ruins."; /// assert_eq!(sentence.to_upper_camel_case(), "WeAreNotInTheLeastAfraidOfRuins"); /// ``` pubtrait ToUpperCamelCase: ToOwned { /// Convert this type to upper camel case. fn to_upper_camel_case(&self) -> Self::Owned;
}
/// `ToPascalCase` is an alias for [`ToUpperCamelCase`]. See ToUpperCamelCase for more /// documentation. pubtrait ToPascalCase: ToOwned { /// Convert this type to upper camel case. fn to_pascal_case(&self) -> Self::Owned;
}
impl<T: ?Sized + ToUpperCamelCase> ToPascalCase for T { fn to_pascal_case(&self) -> Self::Owned { self.to_upper_camel_case()
}
}
/// This wrapper performs a upper camel case conversion in [`fmt::Display`]. /// /// ## Example: /// /// ``` /// use heck::AsUpperCamelCase; /// /// let sentence = "We are not in the least afraid of ruins."; /// assert_eq!(format!("{}", AsUpperCamelCase(sentence)), "WeAreNotInTheLeastAfraidOfRuins"); /// ``` pubstruct AsUpperCamelCase<T: AsRef<str>>(pub T);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.