Type Definition tallystick::approval::DefaultApprovalTally[][src]

type DefaultApprovalTally<T> = ApprovalTally<T, u64>;
Expand description

An approval tally using u64 integers to count votes. DefaultApprovalTally is generally preferred over ApprovalTally. Since this is an alias, refer to ApprovalTally for method documentation.

Example

   use tallystick::approval::DefaultApprovalTally;

   // An election for Judge
   let mut tally = DefaultApprovalTally::<&str>::new(1);
   tally.add(vec!["Judge Judy", "Notorious RBG"]);
   tally.add(vec!["Judge Dredd"]);
   tally.add(vec!["Abe Vigoda", "Notorious RBG"]);
   tally.add(vec!["Judge Dredd", "Notorious RBG"]);

   let winners = tally.winners().into_unranked();
   assert!(winners[0] == "Notorious RBG");