From: Jeff Ober Date: Fri, 17 Jan 2020 15:03:32 +0000 (-0500) Subject: Fix bug in generation of nested table-arrays X-Git-Tag: nailing-cargo/1.0.0~234^2~31 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ca63fda5c00be899de8feac6db65a25c5ae8f521;p=nailing-cargo.git Fix bug in generation of nested table-arrays --- diff --git a/lib/TOML/Tiny/Writer.pm b/lib/TOML/Tiny/Writer.pm index f9fb9c9..7c3067b 100644 --- a/lib/TOML/Tiny/Writer.pm +++ b/lib/TOML/Tiny/Writer.pm @@ -68,18 +68,7 @@ sub to_toml { for (@table_array) { push @buff, '', '[[' . join('.', map{ to_toml_key($_) } @KEYS) . ']]'; - - for my $k (sort keys %$_) { - my $key = to_toml_key($k); - my $val = to_toml($_->{$k}, %param); - - unless ($val) { - $val = '{}' if ref $_->{$k} eq 'HASH'; - $val = '[]' if ref $_->{$k} eq 'ARRAY'; - } - - push @buff, "$key=$val"; - } + push @buff, to_toml($_); } pop @KEYS;