From 250624eb229ec1de9c3275d6a121e65499b115e6 Mon Sep 17 00:00:00 2001 From: TotallyNot <44345987+TotallyNot@users.noreply.github.com> Date: Sat, 29 Jul 2023 17:43:24 +0200 Subject: [PATCH] fixed torn->competition --- torn-api/Cargo.toml | 2 +- torn-api/src/torn.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/torn-api/Cargo.toml b/torn-api/Cargo.toml index 69cf58b..66ba85a 100644 --- a/torn-api/Cargo.toml +++ b/torn-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-api" -version = "0.5.19" +version = "0.5.20" edition = "2021" authors = ["Pyrit [2111649]"] license = "MIT" diff --git a/torn-api/src/torn.rs b/torn-api/src/torn.rs index 20364ce..32fd641 100644 --- a/torn-api/src/torn.rs +++ b/torn-api/src/torn.rs @@ -43,6 +43,7 @@ pub struct EliminationLeaderboard { pub enum Competition { Elimination { teams: Vec }, + Unkown(String), } fn decode_competition<'de, D>(deserializer: D) -> Result, D::Error> @@ -98,7 +99,7 @@ where teams: teams.ok_or_else(|| de::Error::missing_field("teams"))?, })), "" => Ok(None), - v => Err(de::Error::unknown_variant(v, &["Elimination", ""])), + v => Ok(Some(Competition::Unkown(v.to_owned()))), } } }