Members of family are now stored in HashSet instead of Vec

This commit is contained in:
Philip (a-0) 2024-03-23 19:46:38 +01:00
parent 0c2bdb2ee3
commit e0b83d30b6
3 changed files with 15 additions and 11 deletions

View file

@ -1,3 +1,5 @@
use std::collections::HashSet;
use serde::{Deserialize, Serialize};
use super::{FamilyId, PeerId};
@ -6,7 +8,7 @@ use super::{FamilyId, PeerId};
pub struct Family {
pub id: FamilyId,
pub name: Option<String>,
pub members: Vec<PeerId>,
pub members: HashSet<PeerId>,
}
impl Family {
@ -14,7 +16,7 @@ impl Family {
Family {
id,
name,
members,
members: HashSet::from_iter(members.into_iter()),
}
}
}
}