Expand description
§use-case
Composable string casing primitives for RustUse.
use-case keeps case conversion predictable and lightweight. It is aimed at repository naming,
identifier shaping, and small formatting tasks instead of locale-aware typography.
§Included conversions
to_snake_caseto_kebab_caseto_pascal_caseto_camel_caseto_title_caseto_constant_casedetect_case
§Example
use use_case::{detect_case, to_kebab_case, to_pascal_case, TextCase};
assert_eq!(to_kebab_case("HTTPServerError"), "http-server-error");
assert_eq!(to_pascal_case("user_profile"), "UserProfile");
assert_eq!(detect_case("userProfile"), TextCase::Camel);§Scope
- ASCII-first and predictable.
- Conservative with punctuation and repeated separators.
- Unicode letters are preserved for case conversion where Rust’s built-in casing supports them.
Structs§
- Case
Conversion - A reusable case-conversion descriptor.
Enums§
- Case
Error - Errors returned by
CaseConversion. - Text
Case - Describes a detected or requested text case.
Functions§
- detect_
case - Detects the most practical case shape for the input.
- to_
camel_ case - Converts input into
camelCase. - to_
constant_ case - Converts input into
CONSTANT_CASE. - to_
kebab_ case - Converts input into
kebab-case. - to_
pascal_ case - Converts input into
PascalCase. - to_
snake_ case - Converts input into
snake_case. - to_
title_ case - Converts input into title case separated by spaces.