| Crates.io | limace |
| lib.rs | limace |
| version | 0.1.1 |
| created_at | 2025-05-15 12:48:11.943116+00 |
| updated_at | 2025-05-15 13:01:40.993131+00 |
| description | Slugify some strings |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1674917 |
| size | 11,279 |
limace is a fast and minimal slugification utility for Rust. It converts strings into clean, URL-friendly slugs using ASCII characters only. It handles Unicode characters via transliteration and supports customizable separator characters.
deunicode-)Stringuse limace::Slugifier;
fn main() {
let slugifier = Slugifier::default();
assert_eq!(slugifier.slugify("Hello, World!"), "hello-world");
assert_eq!(slugifier.slugify("Crème brûlée"), "creme-brulee");
let custom = Slugifier::default().with_separator('_');
assert_eq!(custom.slugify("Hello, World!"), "hello_world");
}
Add this to your Cargo.toml:
[dependencies]
limace = "0.1"
Then use it in your code:
use limace::Slugifier;
let slug = Slugifier::default().slugify("Rust 2024: Fast & Fearless!");
assert_eq!(slug, "rust-2024-fast-fearless");
You can change the separator using with_separator():
use limace::Slugifier;
let slug = Slugifier::default()
.with_separator('_')
.slugify("Hello, World!");
assert_eq!(slug, "hello_world");
deunicode_char().Licensed under MIT