use-case 0.1.0

Composable string casing primitives for RustUse.
Documentation
  • Coverage
  • 100%
    26 out of 26 items documented1 out of 15 items with examples
  • Size
  • Source code size: 14.86 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 501.45 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 19s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-text
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

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_case
  • to_kebab_case
  • to_pascal_case
  • to_camel_case
  • to_title_case
  • to_constant_case
  • detect_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.