From f5098a8a1b64031ccae995a438e8876c6df38597 Mon Sep 17 00:00:00 2001 From: olesien Date: Tue, 1 Oct 2024 19:35:20 +0200 Subject: [PATCH 1/2] Added faction_tag_image --- torn-api/src/user.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/torn-api/src/user.rs b/torn-api/src/user.rs index 7e7d812..ae40665 100644 --- a/torn-api/src/user.rs +++ b/torn-api/src/user.rs @@ -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>, D::Error> From 1bdc33e40a7079637bd3b01b180abb627850fba0 Mon Sep 17 00:00:00 2001 From: olesien Date: Tue, 1 Oct 2024 20:36:59 +0200 Subject: [PATCH 2/2] Fixed deserializer --- torn-api/src/user.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/torn-api/src/user.rs b/torn-api/src/user.rs index ae40665..6c697fd 100644 --- a/torn-api/src/user.rs +++ b/torn-api/src/user.rs @@ -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, })) } }