From bf76f502942b31da3e755c2775128d88edac27d1 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 10 Aug 2020 15:06:52 -0700 Subject: [PATCH] Support deserializing flattened unit --- serde/src/private/de.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/serde/src/private/de.rs b/serde/src/private/de.rs index eb5424cc8..bcb964a9c 100644 --- a/serde/src/private/de.rs +++ b/serde/src/private/de.rs @@ -2763,6 +2763,13 @@ where } } + fn deserialize_unit(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_unit() + } + forward_to_deserialize_other! { deserialize_bool() deserialize_i8() @@ -2780,7 +2787,6 @@ where deserialize_string() deserialize_bytes() deserialize_byte_buf() - deserialize_unit() deserialize_unit_struct(&'static str) deserialize_seq() deserialize_tuple(usize)