Type Definition tallystick::score::DefaultScoreTally [−][src]
type DefaultScoreTally<T> = ScoreTally<T, u64>;
Expand description
A score tally using u64
integers to count votes.
DefaultScoreTally
is generally preferred over ScoreTally
.
Since this is an alias, refer to ScoreTally
for method documentation.
Example
use tallystick::score::DefaultScoreTally; // An election for Judge let mut tally = DefaultScoreTally::<&str>::new(1); tally.add(vec![("Judge Judy", 5), ("Notorious RBG", 2)]); tally.add(vec![("Judge Dredd", 5)]); tally.add(vec![("Abe Vigoda", 6), ("Notorious RBG", 3)]); tally.add(vec![("Judge Dredd", 1), ("Notorious RBG", 4)]); let winners = tally.winners().into_unranked(); assert!(winners[0] == "Notorious RBG");