diff --git a/src/core.rs b/src/core.rs index 9693c7a..4a4af40 100644 --- a/src/core.rs +++ b/src/core.rs @@ -89,16 +89,14 @@ pub trait Mentionable<'a, Ctx: 'a + Context>: 'a + Serializable { /// Used for walking over object trees to ensure two objects with different references don't collide. fn topology(&self) -> Hash { let mut vec = Vec::new(); - let mut points = Vec::new(); - self.points(&mut points); - for point in points { + for point in self.points_vec() { vec.extend(point.point); } Ctx::hash(&vec) } /// References ([Point]s) to other objects. fn points(&self, points: &mut Vec>>); - + /// [Vec] of [Point]s as used by [`Mentionable::topology`]. fn points_vec(&self) -> Vec>> { let mut points = Vec::new(); self.points(&mut points);