Use WeakDom::full_path_of (#1185)

This commit is contained in:
krakow10
2026-10-01 22:16:41 -07:00
committed by GitHub
parent 9cc7f45dcd
commit 351194ba93
2 changed files with 3 additions and 17 deletions

View File

@@ -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.

View File

@@ -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)]