blonk
March 5, 2026, 9:46pm
1
I'm irrationally happy about the TOML 1.1 support in Rust 1.94.0. Like I'm thinking about baking a cake to celebrate.
Using the example from the announcement post on the Rust blog :
serde = { version = "1.0", features = ["derive"] }
Can now be written as:
serde = {
version = "1.0",
features = ["derive"],
}
cries from happiness
10 Likes
chung
March 5, 2026, 10:57pm
2
What is so special about it? I have never hit the problem.
From sea-orm's Cargo.toml , there is lots of multiple lines and with trailing commas ?
features = [
"default",
"sqlx-all",
"mock",
"proxy",
"rbac",
"schema-sync",
"tracing-spans",
"runtime-tokio-native-tls",
"postgres-array",
"postgres-vector",
"with-ipnetwork",
"with-arrow",
]
bigdecimal = { version = "0.4", default-features = false, features = [
"std",
], optional = true }
Are you saying we cannot do this before 1.94.0?
bigdecimal = {
version = "0.4",
default-features = false,
features = [
"std",
],
optional = true,
}
blonk
March 5, 2026, 11:16pm
3
Indeed -- there are some places where one could split lines before (like with lists). With TOML 1.1, splits can occur in more places.
If the later bigdecimal example you posted is used in Cargo.toml prior to 1.94.0, you'll get:
Error: `cargo metadata` exited with an error: error: newlines are unsupported in inline tables, expected nothing
1 Like
The reason inline tables couldn't be split originally is that toml as designed would really like you to write longer tables as actual tables:
[dependencies]
serde.version = "1.0"
serde.features = ["derive"]
or
[dependencies.serde]
version = "1.0"
features = ["derive"]
The json-like inline table {} syntax is more of a convenience shortcut for very small tables and not very toml-y. Large dependency specs like
bigdecimal = {
version = "0.4",
default-features = false,
features = [
"std",
],
optional = true,
}
would arguably look much nicer if formatted as actual tables.
4 Likes
I agree, I think the only problem then is how the syntax informs us as humans of the intent. When you see an expanded table in most TOML (or TOML -adjacent) files, it's generally a top-level thing, especially in Cargo.toml. So when you expand one dependency like that, it can look strange when you scan.
2 Likes
epage
March 8, 2026, 3:09am
6
I've been coming to the conclusion that each table in a schema should have a canoncial style (standard, inline, dotted) and that this can inform the scema design (e.g. [[bin]] vs bins = [{}]). In my mind, dependencies should only ever be dotted or inline.
My style guide proposal reflects this.
2 Likes