Improve previous fix

This commit is contained in:
Pierre HUBERT 2023-02-10 11:01:35 +01:00
parent 90ad7cfe45
commit bf2aada26f

View File

@ -85,10 +85,11 @@ fn recurse_export(
out: &mut String,
already_processed: &mut HashSet<String>,
) {
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();