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]
name = "riven"
version = "2.21.0"
version = "2.22.0"
authors = ["Mingwei Samuel <mingwei.samuel@gmail.com>"]
repository = "https://github.com/MingweiSamuel/Riven"
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::III)), 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());
let mut last = None;
for next in &mut it {
last = Some(next);
}
let last = it.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,
/// Diamond, the higest non-apex tier. Repr: `140_u8`.
DIAMOND = 140,
/// Emerald. Added in 2023. Repr: `130_u8`.
EMERALD = 130,
/// Platinum. Repr: `120_u8`.
PLATINUM = 120,
/// Gold. Repr: `100_u8`.
@ -109,6 +111,7 @@ impl IntoEnumIterator for Tier {
Self::GRANDMASTER,
Self::MASTER,
Self::DIAMOND,
Self::EMERALD,
Self::PLATINUM,
Self::GOLD,
Self::SILVER,
@ -188,6 +191,7 @@ mod tests {
iter.next();
iter.next();
assert_eq!(Some(Tier::DIAMOND), iter.next());
assert_eq!(Some(Tier::EMERALD), iter.next());
iter.next();
iter.next();
iter.next();
@ -202,6 +206,7 @@ mod tests {
iter.next();
iter.next();
iter.next();
assert_eq!(Some(Tier::EMERALD), iter.next());
assert_eq!(Some(Tier::DIAMOND), iter.next());
iter.next();
iter.next();