From 2147b41d1eaf3060894c7645bfde19d8cf88dafd Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Fri, 11 Dec 2020 12:23:16 -0800 Subject: [PATCH] Add Valorant regions, TEMPORARY fix for #15 --- src/consts/region.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/consts/region.rs b/src/consts/region.rs index 84e586e..cbe860b 100644 --- a/src/consts/region.rs +++ b/src/consts/region.rs @@ -3,6 +3,9 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr }; /// A region served by a single game server. /// Each Riot Games API request is directed at a particular region, /// with tournament API requests directed at the AMERICAS "global" region. +/// +/// Valorant regions are prefixed with `VAL_` due to the name collision with +/// `BR` ("BR1") for LoL and `BR` ("BR") for Valorant. #[derive(Debug)] #[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] #[derive(EnumString, Display, AsRefStr, IntoStaticStr)] @@ -38,6 +41,19 @@ pub enum Region { EUROPE, #[strum(to_string="ASIA", serialize="ASIA")] ASIA, + + #[strum(to_string="AP", serialize="AP")] + VAL_AP, + #[strum(to_string="BR", serialize="BR")] + VAL_BR, + #[strum(to_string="EU", serialize="EU")] + VAL_EU, + #[strum(to_string="KR", serialize="KR")] + VAL_KR, + #[strum(to_string="LATAM", serialize="LATAM")] + VAL_LATAM, + #[strum(to_string="NA", serialize="NA")] + VAL_NA, } #[cfg(test)]