feel free to close if its a duplicate, but i didnt see this filed anywhere
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Default)]
struct Hack(u32, String);
fn main() {
let x = Hack::default();
// works
let y = toml::to_string(&x).unwrap();
// fails
let _: Hack = toml::from_str(&y).unwrap();
}
0rphon@iPhone:~/Coding/playground$ cargo run
Compiling serde v1.0.137
Compiling toml v0.5.9
Compiling playground v0.1.0 (/home/0rphon/Coding/playground)
Finished dev [unoptimized + debuginfo] target(s) in 3.17s
Running `target/debug/playground`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { inner: ErrorInner { kind: Wanted { expected: "a right bracket", found: "a comma" }, line: Some(0), col: 2, at: Some(2), message: "", key: [] } }', src/main.rs:9:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
feel free to close if its a duplicate, but i didnt see this filed anywhere