Skip to content

Commit

Permalink
borrow checker
Browse files Browse the repository at this point in the history
  • Loading branch information
aeyakovenko authored and garious committed Jun 24, 2018
1 parent e929404 commit 8ef8a8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/crdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@ impl Crdt {
*cnt += 1;
trace!("leader {:?} {}", &v.current_leader_id[..4], *cnt);
}
let mut sorted: Vec<_> = table.iter().collect();
let mut sorted: Vec<(&PublicKey, usize)> = table.into_iter().collect();
sorted.sort_by_key(|a| a.1);
sorted.last().map(|a| *(*(*a).0))
sorted.last().map(|a| *a.0)
}

/// TODO: This is obviously the wrong way to do this. Need to implement leader selection
Expand Down

0 comments on commit 8ef8a8d

Please sign in to comment.