#ascii #case-insensitive #no-std #case-preserving

no-std uncased

Case-preserving, ASCII case-insensitive, no_std string types

9 releases

0.9.10 Jan 22, 2024
0.9.9 May 5, 2023
0.9.7 May 17, 2022
0.9.6 Apr 7, 2021
0.9.2 Sep 25, 2020

#82 in Text processing

Download history 215100/week @ 2023-10-27 194762/week @ 2023-11-03 200227/week @ 2023-11-10 128797/week @ 2023-11-17 119037/week @ 2023-11-24 113530/week @ 2023-12-01 168811/week @ 2023-12-08 178532/week @ 2023-12-15 81359/week @ 2023-12-22 126713/week @ 2023-12-29 177906/week @ 2024-01-05 144718/week @ 2024-01-12 124720/week @ 2024-01-19 117639/week @ 2024-01-26 131965/week @ 2024-02-02 113003/week @ 2024-02-09

510,020 downloads per month
Used in 654 crates (10 directly)

MIT/Apache

28KB
441 lines

uncased   crates.io docs.rs

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!");

See the documentation for detailed usage information.

Usage

Add the following to your Cargo.toml:

[dependencies]
uncased = "0.9"

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 }

Note: This crate does not perform Unicode case-folding. For Unicode case-folding, see unicase.

License

uncased is licensed under either of the following, at your option:

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in uncased by you shall be dual licensed as above without any additional terms or conditions.

Dependencies

~180KB