From 0d084c50380a91b0b83ee96eb5e8ae04de7baaf5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 18 Oct 2024 10:42:15 -0700 Subject: [PATCH] Touch up PR 1135 --- src/map.rs | 5 +++-- src/value/de.rs | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/map.rs b/src/map.rs index d8e700c1c..bc9a9307b 100644 --- a/src/map.rs +++ b/src/map.rs @@ -6,6 +6,7 @@ //! [`BTreeMap`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html //! [`IndexMap`]: https://docs.rs/indexmap/*/indexmap/map/struct.IndexMap.html +use crate::error::Error; use crate::value::Value; use alloc::string::String; #[cfg(feature = "preserve_order")] @@ -589,7 +590,7 @@ macro_rules! delegate_iterator { } } -impl<'de> de::IntoDeserializer<'de, crate::Error> for Map { +impl<'de> de::IntoDeserializer<'de, Error> for Map { type Deserializer = Self; fn into_deserializer(self) -> Self::Deserializer { @@ -597,7 +598,7 @@ impl<'de> de::IntoDeserializer<'de, crate::Error> for Map { } } -impl<'de> de::IntoDeserializer<'de, crate::Error> for &'de Map { +impl<'de> de::IntoDeserializer<'de, Error> for &'de Map { type Deserializer = Self; fn into_deserializer(self) -> Self::Deserializer { diff --git a/src/value/de.rs b/src/value/de.rs index b494b981b..dd4698e80 100644 --- a/src/value/de.rs +++ b/src/value/de.rs @@ -11,8 +11,8 @@ use core::fmt; use core::slice; use core::str::FromStr; use serde::de::{ - self, Deserialize, DeserializeSeed, EnumAccess, Expected, IntoDeserializer, MapAccess, - SeqAccess, Unexpected, VariantAccess, Visitor, + self, Deserialize, DeserializeSeed, Deserializer as _, EnumAccess, Expected, IntoDeserializer, + MapAccess, SeqAccess, Unexpected, VariantAccess, Visitor, }; use serde::forward_to_deserialize_any; @@ -597,8 +597,6 @@ impl<'de> VariantAccess<'de> for VariantDeserializer { where V: Visitor<'de>, { - use serde::de::Deserializer; - match self.value { Some(Value::Object(v)) => v.deserialize_any(visitor), Some(other) => Err(serde::de::Error::invalid_type( @@ -1109,8 +1107,6 @@ impl<'de> VariantAccess<'de> for VariantRefDeserializer<'de> { where V: Visitor<'de>, { - use serde::de::Deserializer; - match self.value { Some(Value::Object(v)) => v.deserialize_any(visitor), Some(other) => Err(serde::de::Error::invalid_type(