/// This trait defines a train case conversion. /// /// In Train-Case, word boundaries are indicated by hyphens and words start /// with Capital Letters. /// /// ## Example: /// /// ```rust /// use heck::ToTrainCase; /// /// let sentence = "We are going to inherit the earth."; /// assert_eq!(sentence.to_train_case(), "We-Are-Going-To-Inherit-The-Earth"); /// ``` pubtrait ToTrainCase: ToOwned { /// Convert this type to Train-Case. fn to_train_case(&self) -> Self::Owned;
}
/// This wrapper performs a train case conversion in [`fmt::Display`]. /// /// ## Example: /// /// ``` /// use heck::AsTrainCase; /// /// let sentence = "We are going to inherit the earth."; /// assert_eq!(format!("{}", AsTrainCase(sentence)), "We-Are-Going-To-Inherit-The-Earth"); /// ``` pubstruct AsTrainCase<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.