Fixed deserializer

This commit is contained in:
olesien 2024-10-01 20:36:59 +02:00
parent a1730170e5
commit b4792ecf00

View file

@ -70,6 +70,7 @@ where
DaysInFaction,
Position,
FactionTag,
FactionTagImage,
}
struct FactionVisitor;
@ -90,6 +91,7 @@ where
let mut days_in_faction = None;
let mut position = None;
let mut faction_tag = None;
let mut faction_tag_image = None;
while let Some(key) = map.next_key()? {
match key {
@ -108,6 +110,9 @@ where
Field::FactionTag => {
faction_tag = map.next_value()?;
}
Field::FactionTagImage => {
faction_tag_image = map.next_value()?;
}
}
}
let faction_id = faction_id.ok_or_else(|| de::Error::missing_field("faction_id"))?;
@ -126,6 +131,7 @@ where
days_in_faction,
position,
faction_tag,
faction_tag_image,
}))
}
}