Skip to content

Commit

Permalink
Apply review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGVSV committed Aug 29, 2022
1 parent 65fefab commit 04c28e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/bevy_reflect/src/serde/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ impl<'a, 'de> Visitor<'de> for UntypedReflectDeserializerVisitor<'a> {
A: MapAccess<'de>,
{
let type_name = map
.next_key::<&str>()?
.next_key::<String>()?
.ok_or_else(|| Error::invalid_length(0, &"at least one entry"))?;

let registration = self.registry.get_with_name(type_name).ok_or_else(|| {
let registration = self.registry.get_with_name(&type_name).ok_or_else(|| {
Error::custom(format_args!("No registration found for {}", type_name))
})?;
let type_info = registration.type_info();
Expand Down Expand Up @@ -512,12 +512,12 @@ impl<'a, 'de> Visitor<'de> for EnumVisitor<'a> {
V: MapAccess<'de>,
{
let variant_name = map
.next_key::<&str>()?
.next_key::<String>()?
.ok_or_else(|| Error::missing_field("the variant name of the enum"))?;

let variant_info = self
.enum_info
.variant(variant_name)
.variant(&variant_name)
.ok_or_else(|| Error::custom(format_args!("unknown variant {}", variant_name)))?;

let mut dynamic_enum = DynamicEnum::default();
Expand Down

0 comments on commit 04c28e2

Please sign in to comment.