From 7a7ae1ffdbbad20f817904ba8b99950aaf29dad8 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Mon, 16 Mar 2026 17:59:10 +0100 Subject: [PATCH] removed old comment --- src/format/hierarchical.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/format/hierarchical.rs b/src/format/hierarchical.rs index 5105d2a..ca7fdd1 100644 --- a/src/format/hierarchical.rs +++ b/src/format/hierarchical.rs @@ -121,14 +121,6 @@ impl FormatHandler for HierarchicalHandler { } fn write(&self, path: &Path, vars: &[EnvVar]) -> io::Result<()> { - // For writing hierarchical formats, we ideally want to preserve the original structure. - // But we don't have it here. We should parse the template again to get the structure! - // Oh wait, `write` is called with only `vars`. - // If we want to construct the tree from scratch, it's very difficult to guess array vs object - // and data types without the original template. - // Let's change the trait or just keep a copy of the template? - // Actually, if we require the user to have the template, we can just parse the template, update the leaves, and write. - // We'll write a reconstruction algorithm that just creates objects based on keys. let mut root = Value::Object(Map::new()); for var in vars { insert_into_value(&mut root, &var.key, &var.value); @@ -246,4 +238,4 @@ mod tests { assert!(unflattened_json.contains("\"8080:80\"")); assert!(unflattened_json.contains("true")); } -} \ No newline at end of file +}