character-set

Crates.iocharacter-set
lib.rscharacter-set
version0.4.0
sourcesrc
created_at2022-09-24 09:09:38.032845
updated_at2022-09-28 16:30:27.176382
descriptionHigh performance `set.contains(char)`
homepage
repositoryhttps://github.com/oovm/charset
max_upload_size
id672951
size546,174
SasakiSaki (oovm)

documentation

https://docs.rs/character-set

README

#[test]
fn test_ascii_range() {
    let mut set = CharacterSet::default();
    set.insert('a'..'z');
    set.insert('A'..'Z');
    set.insert('0'..'9');
    set.optimize();
    assert_eq!(set.count(), 62);
    assert!(set.contains('a'));
    assert!(!set.contains(' '));
}
Commit count: 1

cargo fmt