Crates.io | character-set |
lib.rs | character-set |
version | 0.4.0 |
source | src |
created_at | 2022-09-24 09:09:38.032845 |
updated_at | 2022-09-28 16:30:27.176382 |
description | High performance `set.contains(char)` |
homepage | |
repository | https://github.com/oovm/charset |
max_upload_size | |
id | 672951 |
size | 546,174 |
#[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(' '));
}