Uses old Rust 2015
0.1.1 |
|
---|---|
0.1.0 |
|
#3 in #representing
4KB
A simple interface with methods for manipulating sets.
Examples
use set;
use set::Set;
// A set that contains ASCII
let ascii = set::predicate(|c| c as u32 <= 0x7F);
assert!(ascii.contains('a'));
assert!(!ascii.contains('❤'));
let s = set::predicate(|c: char| c.is_uppercase());
assert!(s.contains('B'));
// A char is a quine atom. That is, it is a set that contains only itself.
assert!('t'.contains('t'));
// Functions and closures that match the signature of contains are themselves sets.
assert!(char::is_lowercase.contains('b'));