You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::fs;
use std::process::exit;
use toml::{self, Value};
fn main() {
let filename = "config.toml";
let contents = match fs::read_to_string(filename) {
Ok(c) => c,
Err(_) => {
eprintln!("Could not read file `{}`", filename);
exit(1);
}
};
let data: Value = match toml::from_str(&contents) {
Ok(d) => d,
Err(e) => {
eprintln!("Unable to load data from `{}` {}", filename, e);
exit(1);
}
};
println!("{:?}", data);
}
Running this would result in:
Unable to load data from `config.toml` TOML parse error at line 14, column 9
|
14 | key1 = {
| ^
invalid inline table
expected `}`
Which is unexpected since i believe the key/value pairs should be possible to span multiple lines.
Hello,
If i have:
And the following code:
Running this would result in:
Which is unexpected since i believe the key/value pairs should be possible to span multiple lines.
Apparently, support for this was already merged in the TOML spec: toml-lang/toml#516 in this PR: toml-lang/toml#904
The text was updated successfully, but these errors were encountered: