add a from_ref() method to get a Zone from a &Zone

master
rasul 5 years ago
parent a7855949e7
commit 57ccd45420

@ -17,6 +17,18 @@ pub struct Zone {
pub areas: HashSet<Id>, pub areas: HashSet<Id>,
} }
impl Zone {
pub fn from_ref(zone: &Self) -> Self {
Self {
id: zone.id,
parent: zone.parent,
name: zone.name.clone(),
users_visible: zone.users_visible,
areas: zone.areas.clone(),
}
}
}
impl Area for Zone { impl Area for Zone {
fn id(&self) -> Id { fn id(&self) -> Id {
self.id self.id

Loading…
Cancel
Save