[−][src]Crate uncased
Case-preserving, ASCII case-insensitive no_std
string types.
An uncased string is case-preserving. That is, the string itself contains cased characters, but comparison (including ordering, equality, and hashing) is ASCII case-insensitive.
use uncased::UncasedStr; let x: &UncasedStr = "hello!".into(); let y: &UncasedStr = "HelLo!".into(); assert_eq!(x, y); assert_eq!(x.as_str(), "hello!"); assert_eq!(y.as_str(), "HelLo!"); let x_sub = &x[..4]; let y_sub = &y[..4]; assert_eq!(x_sub, y_sub); assert_eq!(x_sub.as_str(), "hell"); assert_eq!(y_sub.as_str(), "HelL");
Unicode
This crate does not perform Unicode case-folding. For Unicode
case-folding, see unicase
.
Features and no_std
This crate is #![no_std]
compatible. By default, the alloc
feature is
enabled, which enables the Uncased
type but requires alloc
support. To
disable the feature, disable this crate's default features:
[dependencies]
uncased = { version = "0.9", default-features = false }
Structs
Uncased | alloc An uncased (case-insensitive, case-preserving), owned or borrowed ASCII string. |
UncasedStr | A cost-free reference to an uncased (case-insensitive, case-preserving) ASCII string. |
Functions
eq | Returns true if |