From ef205ef70ad30ec284a81827133e6fa93b542afb Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 19 Sep 2021 09:42:33 -0300 Subject: Fix MayBe not being shallow Sadly also a breaking change. Ah well. --- tests/maybe.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') 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::(json).unwrap().bar.is_not()); } + +#[test] +fn test_shallow() { + #[derive(Deserialize)] + struct Foo { + #[serde(rename = "bar")] + _bar: f64, + } + let json = "{\"bar\": []}"; + assert!(from_str::>(json).is_err()); +} -- cgit 1.4.1