Handle removing a node, and a shard disconnecting (bulk remove)

This commit is contained in:
James Wilson
2021-06-25 17:21:24 +01:00
parent 4f60453689
commit 89dfad5bbe
6 changed files with 350 additions and 81 deletions
+7 -1
View File
@@ -10,7 +10,13 @@ pub struct MostSeen<T> {
others: HashMap<T, usize>
}
impl <T: Hash + Eq> MostSeen<T> {
impl <T: Default> Default for MostSeen<T> {
fn default() -> Self {
MostSeen::new(T::default())
}
}
impl <T> MostSeen<T> {
pub fn new(item: T) -> Self {
Self {
current_best: item,