Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
leomanza committed Jan 29, 2025
1 parent 63ac85a commit 5d61e7b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 11 additions & 3 deletions server/src/ranked_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@ impl RankedVote {
timestamp: i64,
nonce: i64,
) -> Self {
Self { account: account.into(), hash: hash.into(), memo: memo.into(), height, status, timestamp, nonce, proposals: vec![] }
Self {
account: account.into(),
hash: hash.into(),
memo: memo.into(),
height,
status,
timestamp,
nonce,
proposals: vec![],
}
}

pub fn update_memo(&mut self, memo: impl Into<String>) {
Expand Down Expand Up @@ -307,8 +316,7 @@ fn candidates_from_ballots(ballots: &[Ballot]) -> Vec<Candidate> {
/// * `coll` the collection of votes to process
/// * `rules` the rules that govern this election
/// * `candidates` the registered candidates for this election. If not provided,
/// the
/// candidates will be inferred from the votes.
/// the candidates will be inferred from the votes.
fn run_voting_stats(
coll: &[Ballot],
rules: &VoteRules,
Expand Down
10 changes: 4 additions & 6 deletions server/src/ranked_vote_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ pub enum OverVoteRule {
/// Consider the ballot `[A, B, B, C]`. After candidate `A` is eliminated:
/// - with Exhaust, this ballot would be entirely discarded
/// - with SkipDuplicate, this ballot would be equivalent to reducing `B` to
/// only
/// a single instance: `[B, C]`.
/// only a single instance: `[B, C]`.
#[derive(Eq, PartialEq, Debug, Clone, Copy)]
pub enum DuplicateCandidateMode {
Exhaust,
Expand All @@ -152,8 +151,8 @@ pub enum DuplicateCandidateMode {
/// The elimination algorithm to apply.
///
/// - Single eliminates one candidate at a time. This is the easiest to
/// understand, but it may add many more rounds when there a lot of
/// candidates with a comparatively very low number of votes.
/// understand, but it may add many more rounds when there a lot of candidates
/// with a comparatively very low number of votes.
///
/// - Batch eliminates candidates more rapidly.
#[derive(Eq, PartialEq, Debug, Clone, Copy)]
Expand All @@ -168,8 +167,7 @@ pub enum EliminationAlgorithm {
/// - Unlimited would read this ballot as `[A]`
/// - ExhaustOnFirstOccurence would discard this ballot
/// - `MaxAllowed(3)` would read this ballot as `[A]`, but `MaxAllowed(2)` or
/// below would
/// exhaust the ballot.
/// below would exhaust the ballot.
///
/// The rule is only applied to sequences of blank or undervotes. For instance,
/// `MaxAllowed(2)` would:
Expand Down

0 comments on commit 5d61e7b

Please sign in to comment.