From 8ebe30cd65085dc529d2473e61c0f468c66e1e40 Mon Sep 17 00:00:00 2001 From: timofey Date: Sat, 22 Apr 2023 21:56:25 +0000 Subject: [PATCH] make topology use points_vec --- src/core.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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);