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 serde::Deserialize;#[derive(Deserialize)]structDataFile{data:Compare,}#[derive(Deserialize)]enumCompare{Gt(u32),}fnmain(){let dotted_table = r#" data.Gt = 5 "#;let inline_table = r#" data = { Gt = 5 } "#;// I wouldn't expect this to errorassert!(toml::from_str::<DataFile>(dotted_table).is_err());// this one is ok, though.assert!(toml::from_str::<DataFile>(inline_table).is_ok());}
The text was updated successfully, but these errors were encountered:
When deserializing a value represented as an
enum
, I receive an error if I use a dotted table, but it parses fine if I use an inline table:ErrorInner { kind: Wanted { expected: "string or inline table", found: "dotted table" } ...
minimal example code:
The text was updated successfully, but these errors were encountered: