diff --git a/src/serde/de.rs b/src/serde/de.rs index ce602dc2..3ba71e2f 100644 --- a/src/serde/de.rs +++ b/src/serde/de.rs @@ -361,9 +361,13 @@ impl<'de> Deserializer<'de> for &mut DynamicDeserializer<'de> { self, visitor: V, ) -> Result> { - self.value + #[cfg(not(feature = "no_index"))] + return self + .value .downcast_ref::() - .map_or_else(|| self.type_error(), |x| visitor.visit_bytes(x)) + .map_or_else(|| self.type_error(), |x| visitor.visit_bytes(x)); + #[cfg(feature = "no_index")] + return self.type_error(); } fn deserialize_byte_buf>(