Skip to content

Commit b3c8ee9

Browse files
committed
feat(toml): do not emit empty tables w/ subtables
TOML Kit 0.13.0 and below emits empty tables when they have subtables. This behavior has changed in TOML Kit 0.13.1.
1 parent 53a2b59 commit b3c8ee9

File tree

3 files changed

+187
-182
lines changed

3 files changed

+187
-182
lines changed

example.toml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ ports = [ 8001, 8001, 8002 ]
1414
connection_max = 5000
1515
enabled = true
1616

17-
[servers]
17+
# You can indent as you please. Tabs or spaces. TOML don't care.
18+
[servers.alpha]
19+
ip = "10.0.0.1"
20+
dc = "eqdc10"
1821

19-
# You can indent as you please. Tabs or spaces. TOML don't care.
20-
[servers.alpha]
21-
ip = "10.0.0.1"
22-
dc = "eqdc10"
23-
24-
[servers.beta]
25-
ip = "10.0.0.2"
26-
dc = "eqdc10"
27-
country = "中国" # This should be parsed as UTF-8
22+
[servers.beta]
23+
ip = "10.0.0.2"
24+
dc = "eqdc10"
25+
country = "中国" # This should be parsed as UTF-8
2826

2927
[clients]
3028
data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it
@@ -37,11 +35,11 @@ hosts = [
3735

3836
# Products
3937

40-
[[products]]
41-
name = "Hammer"
42-
sku = 738594937
38+
[[products]]
39+
name = "Hammer"
40+
sku = 738594937
4341

44-
[[products]]
45-
name = "Nail"
46-
sku = 284758393
47-
color = "gray"
42+
[[products]]
43+
name = "Nail"
44+
sku = 284758393
45+
color = "gray"

0 commit comments

Comments
 (0)