diff --git a/src/syncback/ref_properties.rs b/src/syncback/ref_properties.rs index 054f61b8..94d7ffdf 100644 --- a/src/syncback/ref_properties.rs +++ b/src/syncback/ref_properties.rs @@ -8,10 +8,8 @@ use rbx_dom_weak::{ ustr, Instance, Ustr, WeakDom, }; -use crate::{ - multimap::MultiMap, syncback::snapshot::inst_path, REF_ID_ATTRIBUTE_NAME, - REF_POINTER_ATTRIBUTE_PREFIX, -}; +use crate::syncback::snapshot::inst_path; +use crate::{multimap::MultiMap, REF_ID_ATTRIBUTE_NAME, REF_POINTER_ATTRIBUTE_PREFIX}; pub struct RefLinks { /// A map of referents to each of their Ref properties. diff --git a/src/syncback/snapshot.rs b/src/syncback/snapshot.rs index 384033d6..bc10e76a 100644 --- a/src/syncback/snapshot.rs +++ b/src/syncback/snapshot.rs @@ -222,19 +222,7 @@ pub fn filter_out_property(inst: &Instance, prop_name: &str) -> bool { } pub fn inst_path(dom: &WeakDom, referent: Ref) -> String { - let mut path = Vec::new(); - - let mut inst = dom.get_by_ref(referent); - while let Some(instance) = inst { - path.push(instance.name.as_str()); - inst = dom.get_by_ref(instance.parent()); - } - // This is to avoid the root's name from appearing in the path. Not - // optimal, but should be fine. - path.pop(); - - path.reverse(); - path.join("/") + dom.full_path_of(referent, "/") } #[cfg(test)]