diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2021-09-19 09:42:33 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2021-09-19 09:42:33 -0300 |
commit | ef205ef70ad30ec284a81827133e6fa93b542afb (patch) | |
tree | c17f71ba8222bbfed2cfc3479fb78cdea7e1c157 /tests | |
parent | f17c00795f9b1fc1a7e0c636478e13d66fda737c (diff) |
Fix MayBe not being shallow
Sadly also a breaking change. Ah well.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/maybe.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/maybe.rs b/tests/maybe.rs index 1437195..702f0c5 100644 --- a/tests/maybe.rs +++ b/tests/maybe.rs @@ -47,3 +47,14 @@ fn test_not_t_in_struct() { let json = "{\"bar\": []}"; assert!(from_str::<Foo>(json).unwrap().bar.is_not()); } + +#[test] +fn test_shallow() { + #[derive(Deserialize)] + struct Foo { + #[serde(rename = "bar")] + _bar: f64, + } + let json = "{\"bar\": []}"; + assert!(from_str::<MayBe<Foo>>(json).is_err()); +} |