| Crates.io | facet-singularize |
| lib.rs | facet-singularize |
| version | 0.43.1 |
| created_at | 2025-12-11 16:53:19.661669+00 |
| updated_at | 2026-01-23 08:49:33.099546+00 |
| description | Fast, no-regex English singularization for the facet ecosystem |
| homepage | https://facet.rs |
| repository | https://github.com/facet-rs/facet |
| max_upload_size | |
| id | 1980105 |
| size | 87,478 |
Fast, no-regex English singularization.
This crate converts plural English words to their singular form without using regex.
It's designed for use in deserialization where performance matters—for example, when
mapping JSON field names like "dependencies" to Rust struct fields like dependency.
use facet_singularize::singularize;
assert_eq!(singularize("dependencies"), "dependency");
assert_eq!(singularize("items"), "item");
assert_eq!(singularize("children"), "child");
assert_eq!(singularize("boxes"), "box");
assert_eq!(singularize("matrices"), "matrix");
alloc feature)Benchmarked to be fast enough for hot paths. The implementation prioritizes predictable performance over completeness—it handles the common cases well rather than trying to be a full linguistic library.
Thanks to all individual sponsors:
...along with corporate sponsors:
...without whom this work could not exist.
The facet logo was drawn by Misiasart.
Licensed under either of:
at your option.