From bf2aada26f59362a74efefaccd96dcb901b837da Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Fri, 10 Feb 2023 11:01:35 +0100 Subject: [PATCH] Improve previous fix --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0cd3ce7..170c036 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,10 +85,11 @@ fn recurse_export( out: &mut String, already_processed: &mut HashSet, ) { - if already_processed.contains(&node.name) { + let key = format!("{} #> {}", parent_name, node.name); + if already_processed.contains(&key) { return; } - already_processed.insert(node.name.to_string()); + already_processed.insert(key); if !parent_name.is_empty() && matches!(node.r#type, NodeType::Object { .. }) { writeln!(out, "\"{}\" -> \"{}\";", parent_name, node.name).unwrap();