Crates.io | counter-fpy |
lib.rs | counter-fpy |
version | 0.1.2 |
source | src |
created_at | 2023-12-10 11:28:22.252656 |
updated_at | 2023-12-26 02:07:59.492863 |
description | An implementation of Python's Counter module in Rust |
homepage | https://github.com/blackprince001/counter_fpy |
repository | https://github.com/blackprince001/counter_fpy |
max_upload_size | |
id | 1064155 |
size | 20,950 |
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}");
}
}