Skip to content

Commit

Permalink
Touch up PR 1135
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 18, 2024
1 parent b4954a9 commit 0d084c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -589,15 +590,15 @@ macro_rules! delegate_iterator {
}
}

impl<'de> de::IntoDeserializer<'de, crate::Error> for Map<String, Value> {
impl<'de> de::IntoDeserializer<'de, Error> for Map<String, Value> {
type Deserializer = Self;

fn into_deserializer(self) -> Self::Deserializer {
self
}
}

impl<'de> de::IntoDeserializer<'de, crate::Error> for &'de Map<String, Value> {
impl<'de> de::IntoDeserializer<'de, Error> for &'de Map<String, Value> {
type Deserializer = Self;

fn into_deserializer(self) -> Self::Deserializer {
Expand Down
8 changes: 2 additions & 6 deletions src/value/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 0d084c5

Please sign in to comment.