mirror of https://github.com/MingweiSamuel/Riven
Add `match_v5::Participant::riot_id_game_name()` helper method
parent
db7192ce20
commit
e07b916a08
|
@ -18,4 +18,16 @@ impl Participant {
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
self.champion_id.or_else(|_| self.champion_name.parse())
|
self.champion_id.or_else(|_| self.champion_name.parse())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// This method returns the name portion of the riot ID for this summoner.
|
||||||
|
///
|
||||||
|
/// Prior to patch 14.5, this was in the [`Self::riot_id_name`] field.
|
||||||
|
/// After, this moved to the `Self.riot_id_game_name` field.
|
||||||
|
///
|
||||||
|
/// This method simply returns whichever of the two fields is not `None`.
|
||||||
|
pub fn riot_id_game_name(&self) -> Option<&str> {
|
||||||
|
self.riot_id_game_name
|
||||||
|
.as_deref()
|
||||||
|
.or(self.riot_id_name.as_deref())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue