Skip to content

Instantly share code, notes, and snippets.

@mattyhall
mattyhall / counter.rs
Created July 13, 2018 16:32
A Rust version of Python's counter
use std::cmp::Eq;
use std::collections::HashMap;
use std::hash::Hash;
#[derive(Debug)]
struct Counter<V>
where
V: Eq + Hash,
{
map: HashMap<V, i32>,