counter-fpy

Crates.iocounter-fpy
lib.rscounter-fpy
version0.1.2
sourcesrc
created_at2023-12-10 11:28:22.252656
updated_at2023-12-26 02:07:59.492863
descriptionAn implementation of Python's Counter module in Rust
homepagehttps://github.com/blackprince001/counter_fpy
repositoryhttps://github.com/blackprince001/counter_fpy
max_upload_size
id1064155
size20,950
Prince (blackprince001)

documentation

https://github.com/blackprince001/counter_fpy

README

Counter-fpy

An implementation of Python's Counter module in Rust.

https://docs.python.org/3/library/collections.html?highlight=counter#collections.Counter

Example


use counter_fpy::Counter;

fn main() {
    let sample = ["bxffour", "bxffour", "blackprince"];

    let counter = Counter::new();
    let collection = Counter::from(counter, &sample);

    for (key, count) in collection.iter() {
        println!("Key: {key} has count: {count}");
    }
}

Commit count: 12

cargo fmt