Members of family are now stored in HashSet instead of Vec
This commit is contained in:
parent
0c2bdb2ee3
commit
e0b83d30b6
3 changed files with 15 additions and 11 deletions
|
@ -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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue