/// This trait defines a shouty snake case conversion. /// /// In SHOUTY_SNAKE_CASE, word boundaries are indicated by underscores and all /// words are in uppercase. /// /// ## Example: /// /// ```rust /// use heck::ToShoutySnakeCase; /// /// let sentence = "That world is growing in this minute."; /// assert_eq!(sentence.to_shouty_snake_case(), "THAT_WORLD_IS_GROWING_IN_THIS_MINUTE"); /// ``` pubtrait ToShoutySnakeCase: ToOwned { /// Convert this type to shouty snake case. fn to_shouty_snake_case(&self) -> Self::Owned;
}
/// Oh heck, `ToShoutySnekCase` is an alias for [`ToShoutySnakeCase`]. See /// ToShoutySnakeCase for more documentation. pubtrait ToShoutySnekCase: ToOwned { /// CONVERT THIS TYPE TO SNEK CASE. #[allow(non_snake_case)] fn TO_SHOUTY_SNEK_CASE(&self) -> Self::Owned;
}
impl<T: ?Sized + ToShoutySnakeCase> ToShoutySnekCase for T { fn TO_SHOUTY_SNEK_CASE(&self) -> Self::Owned { self.to_shouty_snake_case()
}
}
/// This wrapper performs a shouty snake case conversion in [`fmt::Display`]. /// /// ## Example: /// /// ``` /// use heck::AsShoutySnakeCase; /// /// let sentence = "That world is growing in this minute."; /// assert_eq!(format!("{}", AsShoutySnakeCase(sentence)), "THAT_WORLD_IS_GROWING_IN_THIS_MINUTE"); /// ``` pubstruct AsShoutySnakeCase<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.