| 1 | use serderust-analyzer cargo serde 1.0.228 crate/::{Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#, Serializerust-analyzer cargo serde_core 1.0.228 ser/Serialize#}; |
| 2 | |
| 3 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)] |
| 4 | struct Srust-analyzer cargo ron 0.12.0 S# { |
| 5 | arust-analyzer cargo ron 0.12.0 S#a.: i8, |
| 6 | brust-analyzer cargo ron 0.12.0 S#b.: i16, |
| 7 | crust-analyzer cargo ron 0.12.0 S#c.: i32, |
| 8 | drust-analyzer cargo ron 0.12.0 S#d.: i64, |
| 9 | #[cfg(feature = "integer128")] |
| 10 | erust-analyzer cargo ron 0.12.0 S#e.: i128, |
| 11 | frust-analyzer cargo ron 0.12.0 S#f.: u8, |
| 12 | grust-analyzer cargo ron 0.12.0 S#g.: u16, |
| 13 | hrust-analyzer cargo ron 0.12.0 S#h.: u32, |
| 14 | irust-analyzer cargo ron 0.12.0 S#i.: u64, |
| 15 | #[cfg(feature = "integer128")] |
| 16 | jrust-analyzer cargo ron 0.12.0 S#j.: u128, |
| 17 | } |
| 18 | |
| 19 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 20 | fn roundtriprust-analyzer cargo ron 0.12.0 roundtrip().() { |
| 21 | let s = Srust-analyzer cargo ron 0.12.0 S# { |
| 22 | arust-analyzer cargo ron 0.12.0 S#a.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::i8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i8/::MINrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i8/MIN., |
| 23 | brust-analyzer cargo ron 0.12.0 S#b.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::i16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i16/::MINrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i16/MIN., |
| 24 | crust-analyzer cargo ron 0.12.0 S#c.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::i32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i32/::MINrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i32/MIN., |
| 25 | drust-analyzer cargo ron 0.12.0 S#d.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::i64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i64/::MINrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i64/MIN., |
| 26 | #[cfg(feature = "integer128")] |
| 27 | erust-analyzer cargo ron 0.12.0 S#e.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::i128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i128/::MINrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/i128/MIN., |
| 28 | frust-analyzer cargo ron 0.12.0 S#f.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::u8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u8/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u8/MAX., |
| 29 | grust-analyzer cargo ron 0.12.0 S#g.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::u16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u16/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u16/MAX., |
| 30 | hrust-analyzer cargo ron 0.12.0 S#h.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::u32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u32/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u32/MAX., |
| 31 | irust-analyzer cargo ron 0.12.0 S#i.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::u64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u64/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u64/MAX., |
| 32 | #[cfg(feature = "integer128")] |
| 33 | jrust-analyzer cargo ron 0.12.0 S#j.: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::u128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u128/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u128/MAX., |
| 34 | }; |
| 35 | let serialized = ronrust-analyzer cargo ron 0.12.0 crate/::serrust-analyzer cargo ron 0.12.0 ser/::to_stringrust-analyzer cargo ron 0.12.0 ser/to_string().(&s).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 36 | let deserialized = ronrust-analyzer cargo ron 0.12.0 crate/::derust-analyzer cargo ron 0.12.0 de/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().(&serialized).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 37 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(s, deserialized,); |
| 38 | } |