Merge pull request #2 from 39C-wallenstein/master

Added faction_tag_image
This commit is contained in:
TotallyNot 2024-10-05 16:05:35 +02:00 committed by GitHub
commit d3518b1f90

View file

@ -55,6 +55,7 @@ pub struct Faction<'a> {
pub days_in_faction: i16,
pub position: &'a str,
pub faction_tag: Option<&'a str>,
pub faction_tag_image: Option<&'a str>,
}
fn deserialize_faction<'de, D>(deserializer: D) -> Result<Option<Faction<'de>>, D::Error>
@ -69,6 +70,7 @@ where
DaysInFaction,
Position,
FactionTag,
FactionTagImage,
}
struct FactionVisitor;
@ -89,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 {
@ -107,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"))?;
@ -125,6 +131,7 @@ where
days_in_faction,
position,
faction_tag,
faction_tag_image,
}))
}
}