mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-27 03:16:33 +00:00
Add match_v5::Participant::riot_id_game_name()
helper method
This commit is contained in:
parent
db7192ce20
commit
e07b916a08
1 changed files with 12 additions and 0 deletions
|
@ -18,4 +18,16 @@ impl Participant {
|
|||
#[allow(deprecated)]
|
||||
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 a new issue