Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing visit_enum #2836

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix action
  • Loading branch information
frederik-uni committed Oct 18, 2024
commit 1286b8a0e007fccfe7eaa25ca19dad8bc0fc7208
14 changes: 8 additions & 6 deletions serde/src/private/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ mod content {
use crate::de::value::{MapDeserializer, SeqDeserializer};
use crate::de::{
self, size_hint, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected,
IgnoredAny, MapAccess, SeqAccess, Unexpected, Visitor,
IgnoredAny, MapAccess, SeqAccess, Unexpected, VariantAccess, Visitor,
};

/// Used from generated code to buffer the contents of the Deserializer when
Expand Down Expand Up @@ -529,12 +529,14 @@ mod content {
where
V: EnumAccess<'de>,
{
use crate::de::VariantAccess;
let (key, data) = tri!(visitor.variant::<String>());
Ok(Content::Map(vec![(
Content::String(key),
tri!(data.newtype_variant::<Self::Value>()),
)]))
Ok(Content::Map(
[(
Content::String(key),
tri!(data.newtype_variant::<Self::Value>()),
)]
.into(),
))
}
}

Expand Down