fastset 0.5.1

Fast set implementation for dense, bounded integer collections, optimized for quick updates and access.
Documentation
use fastset::Set;

fn main() {
    let max_element = 100_000_000;
    let sparse_factor = 64;

    // Initialize the Set
    let mut set = Set::with_max(max_element);

    // Populate the set with sparse data
    for i in (0..max_element).step_by(sparse_factor) {
        set.insert(i);
    }

    // Perform some operations to simulate usage
    for i in (0..max_element).step_by(sparse_factor * 2) {
        assert!(set.contains(&i));
    }

    for i in (0..max_element).step_by(sparse_factor * 3) {
        set.remove(&i);
    }

    // Keep the binary from exiting immediately in release mode optimizations
    println!("Finished processing. Press ENTER to exit.");
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
}