| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#; |
| 2 | |
| 3 | use ronrust-analyzer cargo ron 0.12.0 crate/::{ |
| 4 | derust-analyzer cargo ron 0.12.0 de/::from_strrust-analyzer cargo ron 0.12.0 de/from_str()., |
| 5 | errorrust-analyzer cargo ron 0.12.0 error/::Errorrust-analyzer cargo ron 0.12.0 error/Error#, |
| 6 | extensionsrust-analyzer cargo ron 0.12.0 extensions/::Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#, |
| 7 | serrust-analyzer cargo ron 0.12.0 ser/::{to_string_prettyrust-analyzer cargo ron 0.12.0 ser/to_string_pretty()., PrettyConfigrust-analyzer cargo ron 0.12.0 ser/PrettyConfig#}, |
| 8 | }; |
| 9 | 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#}; |
| 10 | |
| 11 | #[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:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, 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:)] |
| 12 | enum TestEnumrust-analyzer cargo ron 0.12.0 TestEnum# { |
| 13 | Unitrust-analyzer cargo ron 0.12.0 TestEnum#Unit#, |
| 14 | PrimitiveNewtyperust-analyzer cargo ron 0.12.0 TestEnum#PrimitiveNewtype#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 15 | Tuplerust-analyzer cargo ron 0.12.0 TestEnum#Tuple#(u32, bool), |
| 16 | Structrust-analyzer cargo ron 0.12.0 TestEnum#Struct# { arust-analyzer cargo ron 0.12.0 TestEnum#Struct#a.: u32, brust-analyzer cargo ron 0.12.0 TestEnum#Struct#b.: bool }, |
| 17 | TupleNewtypeUnitrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeUnit#(Unitrust-analyzer cargo ron 0.12.0 Unit#), |
| 18 | TupleNewtypeNewtyperust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeNewtype#(Newtyperust-analyzer cargo ron 0.12.0 Newtype#), |
| 19 | TupleNewtypeTuplerust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeTuple#((u32, bool)), |
| 20 | TupleNewtypeTupleStructrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeTupleStruct#(TupleStructrust-analyzer cargo ron 0.12.0 TupleStruct#), |
| 21 | TupleNewtypeStructrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeStruct#(Structrust-analyzer cargo ron 0.12.0 Struct#), |
| 22 | TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#), |
| 23 | TupleNewtypeOptionrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeOption#(Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Structrust-analyzer cargo ron 0.12.0 Struct#>), |
| 24 | TupleNewtypeSeqrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeSeq#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Structrust-analyzer cargo ron 0.12.0 Struct#>), |
| 25 | TupleNewtypeMaprust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeMap#(HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<u32, Structrust-analyzer cargo ron 0.12.0 Struct#>), |
| 26 | } |
| 27 | |
| 28 | #[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:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, 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:)] |
| 29 | struct Unitrust-analyzer cargo ron 0.12.0 Unit#; |
| 30 | |
| 31 | #[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:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, 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:)] |
| 32 | struct Newtyperust-analyzer cargo ron 0.12.0 Newtype#(i32); |
| 33 | |
| 34 | #[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:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, 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:)] |
| 35 | struct TupleStructrust-analyzer cargo ron 0.12.0 TupleStruct#(u32, bool); |
| 36 | |
| 37 | #[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:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, 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:)] |
| 38 | struct Structrust-analyzer cargo ron 0.12.0 Struct# { |
| 39 | arust-analyzer cargo ron 0.12.0 Struct#a.: u32, |
| 40 | brust-analyzer cargo ron 0.12.0 Struct#b.: bool, |
| 41 | } |
| 42 | |
| 43 | #[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:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, 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:)] |
| 44 | enum Enumrust-analyzer cargo ron 0.12.0 Enum# { |
| 45 | Arust-analyzer cargo ron 0.12.0 Enum#A#, |
| 46 | Brust-analyzer cargo ron 0.12.0 Enum#B#(Structrust-analyzer cargo ron 0.12.0 Struct#), |
| 47 | Crust-analyzer cargo ron 0.12.0 Enum#C#(u32, bool), |
| 48 | Drust-analyzer cargo ron 0.12.0 Enum#D# { arust-analyzer cargo ron 0.12.0 Enum#D#a.: u32, brust-analyzer cargo ron 0.12.0 Enum#D#b.: bool }, |
| 49 | } |
| 50 | |
| 51 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 52 | fn test_deserialise_non_newtypesrust-analyzer cargo ron 0.12.0 test_deserialise_non_newtypes().() { |
| 53 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 54 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] Unit"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 55 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::Unitrust-analyzer cargo ron 0.12.0 TestEnum#Unit#, |
| 56 | ); |
| 57 | |
| 58 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 59 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] PrimitiveNewtype("hi")"#) |
| 60 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 61 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::PrimitiveNewtyperust-analyzer cargo ron 0.12.0 TestEnum#PrimitiveNewtype#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("hi")), |
| 62 | ); |
| 63 | |
| 64 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 65 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] Tuple(4, false)"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 66 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::Tuplerust-analyzer cargo ron 0.12.0 TestEnum#Tuple#(4, false), |
| 67 | ); |
| 68 | |
| 69 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 70 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] Struct(a: 4, b: false)"#) |
| 71 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 72 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::Structrust-analyzer cargo ron 0.12.0 TestEnum#Struct# { arust-analyzer cargo ron 0.12.0 TestEnum#Struct#a.: 4, brust-analyzer cargo ron 0.12.0 TestEnum#Struct#b.: false }, |
| 73 | ); |
| 74 | } |
| 75 | |
| 76 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 77 | fn test_deserialise_tuple_newtypesrust-analyzer cargo ron 0.12.0 test_deserialise_tuple_newtypes().() { |
| 78 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 79 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeUnit(Unit)"#) |
| 80 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 81 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 82 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLikeEnd#, |
| 83 | ); |
| 84 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 85 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeUnit(())"#) |
| 86 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 87 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 88 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLikeEnd#, |
| 89 | ); |
| 90 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 91 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeUnit()"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 92 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeUnitrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeUnit#(Unitrust-analyzer cargo ron 0.12.0 Unit#), |
| 93 | ); |
| 94 | |
| 95 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 96 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 97 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeNewtype(Newtype(4))"# |
| 98 | ) |
| 99 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 100 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 101 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIntegerrust-analyzer cargo ron 0.12.0 error/Error#ExpectedInteger#, |
| 102 | ); |
| 103 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 104 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeNewtype((4))"#) |
| 105 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 106 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 107 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIntegerrust-analyzer cargo ron 0.12.0 error/Error#ExpectedInteger#, |
| 108 | ); |
| 109 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 110 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeNewtype(4)"#) |
| 111 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 112 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeNewtyperust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeNewtype#(Newtyperust-analyzer cargo ron 0.12.0 Newtype#(4)), |
| 113 | ); |
| 114 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 115 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_newtypes)] TupleNewtypeNewtype(4)"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 116 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeNewtyperust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeNewtype#(Newtyperust-analyzer cargo ron 0.12.0 Newtype#(4)), |
| 117 | ); |
| 118 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 119 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_newtypes)] #![enable(unwrap_variant_newtypes)] TupleNewtypeNewtype(4)"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 120 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeNewtyperust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeNewtype#(Newtyperust-analyzer cargo ron 0.12.0 Newtype#(4)), |
| 121 | ); |
| 122 | |
| 123 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 124 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 125 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeTuple((4, false))"# |
| 126 | ) |
| 127 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 128 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 129 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIntegerrust-analyzer cargo ron 0.12.0 error/Error#ExpectedInteger#, |
| 130 | ); |
| 131 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 132 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeTuple(4, false)"#) |
| 133 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 134 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeTuplerust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeTuple#((4, false)), |
| 135 | ); |
| 136 | |
| 137 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 138 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 139 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeTupleStruct(TupleStruct(4, false))"# |
| 140 | ) |
| 141 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 142 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 143 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIntegerrust-analyzer cargo ron 0.12.0 error/Error#ExpectedInteger#, |
| 144 | ); |
| 145 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 146 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 147 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeTupleStruct((4, false))"# |
| 148 | ) |
| 149 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 150 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 151 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIntegerrust-analyzer cargo ron 0.12.0 error/Error#ExpectedInteger#, |
| 152 | ); |
| 153 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 154 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 155 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeTupleStruct(4, false)"# |
| 156 | ) |
| 157 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 158 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeTupleStructrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeTupleStruct#(TupleStructrust-analyzer cargo ron 0.12.0 TupleStruct#(4, false)), |
| 159 | ); |
| 160 | |
| 161 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 162 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 163 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeStruct(Struct(a: 4, b: false))"# |
| 164 | ) |
| 165 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 166 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 167 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMapColonrust-analyzer cargo ron 0.12.0 error/Error#ExpectedMapColon#, |
| 168 | ); |
| 169 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 170 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 171 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeStruct((a: 4, b: false))"# |
| 172 | ) |
| 173 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 174 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 175 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIdentifierrust-analyzer cargo ron 0.12.0 error/Error#ExpectedIdentifier#, |
| 176 | ); |
| 177 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 178 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 179 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeStruct(a: 4, b: false)"# |
| 180 | ) |
| 181 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 182 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeStructrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeStruct#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false }), |
| 183 | ); |
| 184 | |
| 185 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 186 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeEnum(A)"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 187 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#::Arust-analyzer cargo ron 0.12.0 Enum#A#), |
| 188 | ); |
| 189 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 190 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 191 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeEnum(B(a: 4, b: false))"# |
| 192 | ) |
| 193 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 194 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#::Brust-analyzer cargo ron 0.12.0 Enum#B#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })), |
| 195 | ); |
| 196 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 197 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeEnum(C 4, false)"#) |
| 198 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 199 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 200 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#, |
| 201 | ); |
| 202 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 203 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 204 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeEnum(C(4, false))"# |
| 205 | ) |
| 206 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 207 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#::Crust-analyzer cargo ron 0.12.0 Enum#C#(4, false)), |
| 208 | ); |
| 209 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 210 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 211 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeEnum(D a: 4, b: false)"# |
| 212 | ) |
| 213 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 214 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 215 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#, |
| 216 | ); |
| 217 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 218 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 219 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeEnum(D(a: 4, b: false))"# |
| 220 | ) |
| 221 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 222 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#::Drust-analyzer cargo ron 0.12.0 Enum#D# { arust-analyzer cargo ron 0.12.0 Enum#D#a.: 4, brust-analyzer cargo ron 0.12.0 Enum#D#b.: false }), |
| 223 | ); |
| 224 | |
| 225 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 226 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeOption(None)"#) |
| 227 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 228 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeOptionrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeOption#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), |
| 229 | ); |
| 230 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 231 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 232 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeOption(Some(a: 4, b: false))"# |
| 233 | ) |
| 234 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 235 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeOptionrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeOption#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })), |
| 236 | ); |
| 237 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 238 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 239 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeOption(a: 4, b: false)"# |
| 240 | ) |
| 241 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 242 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 243 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedOptionrust-analyzer cargo ron 0.12.0 error/Error#ExpectedOption#, |
| 244 | ); |
| 245 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 246 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes, implicit_some)] TupleNewtypeOption(a: 4, b: false)"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 247 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeOptionrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeOption#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })), |
| 248 | ); |
| 249 | |
| 250 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 251 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeSeq([])"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 252 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeSeqrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeSeq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![]), |
| 253 | ); |
| 254 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 255 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 256 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeSeq([(a: 4, b: false)])"# |
| 257 | ) |
| 258 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 259 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeSeqrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeSeq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false }]), |
| 260 | ); |
| 261 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 262 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 263 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeSeq([Struct(a: 4, b: false)])"# |
| 264 | ) |
| 265 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 266 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeSeqrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeSeq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false }]), |
| 267 | ); |
| 268 | |
| 269 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 270 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>(r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeMap({})"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 271 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeMaprust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeMap#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![].into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()), |
| 272 | ); |
| 273 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 274 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 275 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeMap({2: (a: 4, b: false)})"# |
| 276 | ) |
| 277 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 278 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeMaprust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeMap#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![(2, Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })].into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()), |
| 279 | ); |
| 280 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 281 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#>( |
| 282 | r#"#![enable(unwrap_variant_newtypes)] TupleNewtypeMap({8: Struct(a: 4, b: false)})"# |
| 283 | ) |
| 284 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 285 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeMaprust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeMap#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![(8, Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })].into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()), |
| 286 | ); |
| 287 | } |
| 288 | |
| 289 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 290 | fn test_newtype_somerust-analyzer cargo ron 0.12.0 test_newtype_some().() { |
| 291 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 292 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Structrust-analyzer cargo ron 0.12.0 Struct#>>(r#"Some((a: 4, b: false))"#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 293 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false }), |
| 294 | ); |
| 295 | |
| 296 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 297 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Structrust-analyzer cargo ron 0.12.0 Struct#>>(r#"Some(a: 4, b: false)"#) |
| 298 | .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 299 | .coderust-analyzer cargo ron 0.12.0 error/SpannedError#code., |
| 300 | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedDifferentStructNamerust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName# { |
| 301 | expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#expected.: "Struct", |
| 302 | foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("a"), |
| 303 | }, |
| 304 | ); |
| 305 | |
| 306 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 307 | from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Structrust-analyzer cargo ron 0.12.0 Struct#>>(r#"#![enable(unwrap_variant_newtypes)] Some(a: 4, b: false)"#) |
| 308 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 309 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false }), |
| 310 | ); |
| 311 | } |
| 312 | |
| 313 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 314 | fn test_serialise_non_newtypesrust-analyzer cargo ron 0.12.0 test_serialise_non_newtypes().() { |
| 315 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().(TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::Unitrust-analyzer cargo ron 0.12.0 TestEnum#Unit#, Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES.); |
| 316 | |
| 317 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 318 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::PrimitiveNewtyperust-analyzer cargo ron 0.12.0 TestEnum#PrimitiveNewtype#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("hi")), |
| 319 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 320 | ); |
| 321 | |
| 322 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 323 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::Tuplerust-analyzer cargo ron 0.12.0 TestEnum#Tuple#(4, false), |
| 324 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 325 | ); |
| 326 | |
| 327 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 328 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::Structrust-analyzer cargo ron 0.12.0 TestEnum#Struct# { arust-analyzer cargo ron 0.12.0 TestEnum#Struct#a.: 4, brust-analyzer cargo ron 0.12.0 TestEnum#Struct#b.: false }, |
| 329 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 330 | ); |
| 331 | } |
| 332 | |
| 333 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 334 | fn test_serialise_tuple_newtypesrust-analyzer cargo ron 0.12.0 test_serialise_tuple_newtypes().() { |
| 335 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 336 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeUnitrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeUnit#(Unitrust-analyzer cargo ron 0.12.0 Unit#), |
| 337 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 338 | ); |
| 339 | |
| 340 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 341 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeNewtyperust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeNewtype#(Newtyperust-analyzer cargo ron 0.12.0 Newtype#(4)), |
| 342 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 343 | ); |
| 344 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 345 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeNewtyperust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeNewtype#(Newtyperust-analyzer cargo ron 0.12.0 Newtype#(4)), |
| 346 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_NEWTYPES., |
| 347 | ); |
| 348 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 349 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeNewtyperust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeNewtype#(Newtyperust-analyzer cargo ron 0.12.0 Newtype#(4)), |
| 350 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES. rust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions][`BitOr<Self>`]bitor().|rust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions][`BitOr<Self>`]bitor(). rust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions][`BitOr<Self>`]bitor().Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_NEWTYPES., |
| 351 | ); |
| 352 | |
| 353 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 354 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeTuplerust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeTuple#((4, false)), |
| 355 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 356 | ); |
| 357 | |
| 358 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 359 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeTupleStructrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeTupleStruct#(TupleStructrust-analyzer cargo ron 0.12.0 TupleStruct#(4, false)), |
| 360 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 361 | ); |
| 362 | |
| 363 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 364 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeStructrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeStruct#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false }), |
| 365 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 366 | ); |
| 367 | |
| 368 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 369 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#::Arust-analyzer cargo ron 0.12.0 Enum#A#), |
| 370 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 371 | ); |
| 372 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 373 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#::Brust-analyzer cargo ron 0.12.0 Enum#B#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })), |
| 374 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 375 | ); |
| 376 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 377 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#::Crust-analyzer cargo ron 0.12.0 Enum#C#(4, false)), |
| 378 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 379 | ); |
| 380 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 381 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeEnumrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeEnum#(Enumrust-analyzer cargo ron 0.12.0 Enum#::Drust-analyzer cargo ron 0.12.0 Enum#D# { arust-analyzer cargo ron 0.12.0 Enum#D#a.: 4, brust-analyzer cargo ron 0.12.0 Enum#D#b.: false }), |
| 382 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 383 | ); |
| 384 | |
| 385 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 386 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeOptionrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeOption#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), |
| 387 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 388 | ); |
| 389 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 390 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeOptionrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeOption#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })), |
| 391 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 392 | ); |
| 393 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 394 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeOptionrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeOption#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })), |
| 395 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::IMPLICIT_SOMErust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]IMPLICIT_SOME., |
| 396 | ); |
| 397 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 398 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeOptionrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeOption#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })), |
| 399 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES. rust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions][`BitOr<Self>`]bitor().|rust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions][`BitOr<Self>`]bitor(). rust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions][`BitOr<Self>`]bitor().Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::IMPLICIT_SOMErust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]IMPLICIT_SOME., |
| 400 | ); |
| 401 | |
| 402 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 403 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeSeqrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeSeq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![]), |
| 404 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 405 | ); |
| 406 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 407 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeSeqrust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeSeq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false }]), |
| 408 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 409 | ); |
| 410 | |
| 411 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 412 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeMaprust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeMap#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![].into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()), |
| 413 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 414 | ); |
| 415 | assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().( |
| 416 | TestEnumrust-analyzer cargo ron 0.12.0 TestEnum#::TupleNewtypeMaprust-analyzer cargo ron 0.12.0 TestEnum#TupleNewtypeMap#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![(2, Structrust-analyzer cargo ron 0.12.0 Struct# { arust-analyzer cargo ron 0.12.0 Struct#a.: 4, brust-analyzer cargo ron 0.12.0 Struct#b.: false })].into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()), |
| 417 | Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::UNWRAP_VARIANT_NEWTYPESrust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]UNWRAP_VARIANT_NEWTYPES., |
| 418 | ); |
| 419 | } |
| 420 | |
| 421 | fn assert_eq_serialize_roundtriprust-analyzer cargo ron 0.12.0 assert_eq_serialize_roundtrip().< |
| 422 | S: Serializerust-analyzer cargo serde_core 1.0.228 ser/Serialize# + serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::DeserializeOwnedrust-analyzer cargo serde_core 1.0.228 de/DeserializeOwned# + PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# + corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#, |
| 423 | >( |
| 424 | value: S, |
| 425 | extensions: Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#, |
| 426 | ) { |
| 427 | let ron = to_string_prettyrust-analyzer cargo ron 0.12.0 ser/to_string_pretty().(&value, PrettyConfigrust-analyzer cargo ron 0.12.0 ser/PrettyConfig#::defaultrust-analyzer cargo ron 0.12.0 ser/impl#[PrettyConfig][Default]default().().extensionsrust-analyzer cargo ron 0.12.0 ser/impl#[PrettyConfig]extensions().(extensions)).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 428 | let result = from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<S>(&ron); |
| 429 | |
| 430 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(result.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]as_ref().(), Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(&value), "{}", ron,); |
| 431 | } |