forked from mirror/Riven
1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
Mingwei Samuel 8217e770c0 Release 2.22.0 2023-07-21 08:45:44 -07:00
Mingwei Samuel 07a96f5fa9 Add EMERALD tier 2023-07-21 00:48:22 -07:00
3 changed files with 11 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "riven" name = "riven"
version = "2.21.0" version = "2.22.0"
authors = ["Mingwei Samuel <mingwei.samuel@gmail.com>"] authors = ["Mingwei Samuel <mingwei.samuel@gmail.com>"]
repository = "https://github.com/MingweiSamuel/Riven" repository = "https://github.com/MingweiSamuel/Riven"
description = "Riot Games API Library" description = "Riot Games API Library"

View File

@ -90,12 +90,12 @@ mod tests {
assert_eq!(Some((Tier::DIAMOND, Division::II)), it.next()); assert_eq!(Some((Tier::DIAMOND, Division::II)), it.next());
assert_eq!(Some((Tier::DIAMOND, Division::III)), it.next()); assert_eq!(Some((Tier::DIAMOND, Division::III)), it.next());
assert_eq!(Some((Tier::DIAMOND, Division::IV)), it.next()); assert_eq!(Some((Tier::DIAMOND, Division::IV)), it.next());
assert_eq!(Some((Tier::EMERALD, Division::I)), it.next());
assert_eq!(Some((Tier::EMERALD, Division::II)), it.next());
assert_eq!(Some((Tier::EMERALD, Division::III)), it.next());
assert_eq!(Some((Tier::EMERALD, Division::IV)), it.next());
assert_eq!(Some((Tier::PLATINUM, Division::I)), it.next()); assert_eq!(Some((Tier::PLATINUM, Division::I)), it.next());
let mut last = None; let last = it.last();
for next in &mut it {
last = Some(next);
}
assert_eq!(Some((Tier::IRON, Division::IV)), last); assert_eq!(Some((Tier::IRON, Division::IV)), last);
assert_eq!(None, it.next());
} }
} }

View File

@ -38,6 +38,8 @@ pub enum Tier {
MASTER = 180, MASTER = 180,
/// Diamond, the higest non-apex tier. Repr: `140_u8`. /// Diamond, the higest non-apex tier. Repr: `140_u8`.
DIAMOND = 140, DIAMOND = 140,
/// Emerald. Added in 2023. Repr: `130_u8`.
EMERALD = 130,
/// Platinum. Repr: `120_u8`. /// Platinum. Repr: `120_u8`.
PLATINUM = 120, PLATINUM = 120,
/// Gold. Repr: `100_u8`. /// Gold. Repr: `100_u8`.
@ -109,6 +111,7 @@ impl IntoEnumIterator for Tier {
Self::GRANDMASTER, Self::GRANDMASTER,
Self::MASTER, Self::MASTER,
Self::DIAMOND, Self::DIAMOND,
Self::EMERALD,
Self::PLATINUM, Self::PLATINUM,
Self::GOLD, Self::GOLD,
Self::SILVER, Self::SILVER,
@ -188,6 +191,7 @@ mod tests {
iter.next(); iter.next();
iter.next(); iter.next();
assert_eq!(Some(Tier::DIAMOND), iter.next()); assert_eq!(Some(Tier::DIAMOND), iter.next());
assert_eq!(Some(Tier::EMERALD), iter.next());
iter.next(); iter.next();
iter.next(); iter.next();
iter.next(); iter.next();
@ -202,6 +206,7 @@ mod tests {
iter.next(); iter.next();
iter.next(); iter.next();
iter.next(); iter.next();
assert_eq!(Some(Tier::EMERALD), iter.next());
assert_eq!(Some(Tier::DIAMOND), iter.next()); assert_eq!(Some(Tier::DIAMOND), iter.next());
iter.next(); iter.next();
iter.next(); iter.next();