From a493f868d4da9863bda33b55bc687ebdce5ef6b5 Mon Sep 17 00:00:00 2001 From: rasul Date: Sun, 5 Apr 2020 15:58:53 -0500 Subject: [PATCH] impl From<&Zone> instead of the from_ref() method --- src/world/zone.rs | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/src/world/zone.rs b/src/world/zone.rs index 592acf0..d954357 100644 --- a/src/world/zone.rs +++ b/src/world/zone.rs @@ -28,31 +28,8 @@ pub struct Zone { pub areas: HashSet, } -impl Zone { - /// Create a new `Zone` from a `&Zone`. - /// - /// # Arguments - /// - /// * `zone: &Zone` : Reference to a `Zone` - /// - /// # Examples - /// - /// ``` - /// use std::collections::HashSet; - /// use rude::id::Id; - /// use rude::world::Zone; - /// - /// let zone = Zone { - /// id: Id::new(), - /// parent: Id::new(), - /// name: "Zone".into(), - /// users_visible: false, - /// areas: HashSet::new(), - /// }; - /// - /// assert_eq!(zone, Zone::from_ref(&zone)); - /// ``` - pub fn from_ref(zone: &Self) -> Self { +impl From<&Zone> for Zone { + fn from(zone: &Zone) -> Self { Self { id: zone.id, parent: zone.parent,