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
This is probably carried over from toml-rs, but reproducing anyway.
use serde::{Deserialize,Serialize};#[derive(Debug,Deserialize,Serialize)]pubstructModule1{x:u8,y:u8}#[derive(Debug,Deserialize,Serialize)]pubstructModule2{h:u8,i:u8}#[derive(Debug,Deserialize,Serialize)]pubenumModule{Module1(Module1),Module2(Module2)}#[derive(Debug,Deserialize,Serialize)]pubstructContainer{modules:Vec<Module>,}#[cfg(test)]mod tests {usesuper::*;use serde_json;use toml;#[test]fntest_container_serialization(){let module1 = Module1{x:4,y:5};let module2 = Module2{h:2,i:3};let container:Container = Container{modules:vec![Module::Module1(module1),Module::Module2(module2)]};dbg!(serde_json::to_string(&container).unwrap());// This worksdbg!(toml_edit::easy::to_string(&container).unwrap());// This panicsdbg!(toml::to_string(&container).unwrap());// This also panics}}
The text was updated successfully, but these errors were encountered:
This is probably carried over from toml-rs, but reproducing anyway.
The text was updated successfully, but these errors were encountered: