From 7268f39e6a6a7379ee2ac0d6260892c19f5e83a7 Mon Sep 17 00:00:00 2001 From: Yan Chen Date: Mon, 16 Oct 2023 19:40:10 -0700 Subject: [PATCH] fix --- rust/candid/src/de.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/candid/src/de.rs b/rust/candid/src/de.rs index ab7bb70f..036440c6 100644 --- a/rust/candid/src/de.rs +++ b/rust/candid/src/de.rs @@ -423,7 +423,11 @@ impl<'de> Deserializer<'de> { where V: Visitor<'de>, { - Err(Error::msg("Cannot decode empty type")) + Err(if *self.wire_type == TypeInner::Empty { + Error::msg("Cannot decode empty type") + } else { + Error::subtype("Cannot decode empty type") + }) } fn deserialize_future<'a, V>(&'a mut self, visitor: V) -> Result where