use-slug 0.1.0

Composable slug and URL-safe text primitives for RustUse.
Documentation
  • Coverage
  • 100%
    20 out of 20 items documented1 out of 15 items with examples
  • Size
  • Source code size: 9.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 481.22 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 29s Average build duration of successful builds.
  • all releases: 29s 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-slug

Composable slug and URL-safe text primitives for RustUse.

use-slug is intentionally conservative in v0.1. It lowercases ASCII text, trims whitespace, collapses repeated separators, and avoids transliteration tables or locale-aware behavior.

Included primitives

  • slugify
  • normalize_slug
  • is_slug
  • slug_words
  • truncate_slug

Example

use use_slug::{is_slug, slugify, truncate_slug};

assert_eq!(slugify(" Release Candidate 1 "), "release-candidate-1");
assert!(is_slug("release-candidate-1"));
assert_eq!(truncate_slug("release-candidate-1", 10), "release");