use serde_derive::{Deserialize, Serialize}; #[test] fn serialize_obj() { #[derive(Serialize, Deserialize)] struct TestStruct { a: u8, b: u8, } assert_eq!( "{\"a\":1,\"b\":2}", litl::to_string(&TestStruct { a: 1, b: 2 }).unwrap() ); #[derive(Serialize, Deserialize)] struct TestStruct2 { b: u128, a: u8, } assert_eq!( "{\"a\":1,\"b\":2}", litl::to_string(&TestStruct { a: 1, b: 2 }).unwrap() ); }