This commit is contained in:
2025-11-15 01:10:19 +00:00
parent 07c02ab5ae
commit c3ca061270
+6 -4
View File
@@ -1986,13 +1986,15 @@ def build_indexes():
graph.add_node(node_id, **base_attrs, type=node_type)
# Try to find the target struct/trait that this impl implements
# Guard against empty lists that can be returned by the Rust parser
target_name = None
if "implements_traits" in m:
target_name = m["implements_traits"][0] # assume first trait
elif "implements" in m:
if "implements_traits" in m and isinstance(m["implements_traits"], list) and m["implements_traits"]:
# assume first trait
target_name = m["implements_traits"][0]
elif "implements" in m and isinstance(m["implements"], list) and m["implements"]:
target_name = m["implements"][0]
if target_name:
target_node_id = f"{lang}::struct::{fpath}::{target_name}"
if target_node_id not in graph.graph: