This commit is contained in:
parent
f0ab2e9530
commit
eb4b238256
1 changed files with 4 additions and 3 deletions
|
@ -15,8 +15,7 @@ struct ChampionResponse {
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
struct Champion {
|
struct Champion {
|
||||||
key: String,
|
key: Option<String>,
|
||||||
name: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DataSource for PBDataSource {
|
impl DataSource for PBDataSource {
|
||||||
|
@ -42,7 +41,9 @@ impl DataSource for PBDataSource {
|
||||||
let data: ChampionResponse = serde_json::from_str(&page).unwrap();
|
let data: ChampionResponse = serde_json::from_str(&page).unwrap();
|
||||||
|
|
||||||
for champ in data.champions {
|
for champ in data.champions {
|
||||||
champs.insert(champ.key.parse::<u32>().unwrap(), vec!["ANY".to_owned()]);
|
if let Some(k) = champ.key {
|
||||||
|
champs.insert(k.parse::<u32>().unwrap(), vec!["ANY".to_owned()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
champs
|
champs
|
||||||
|
|
Loading…
Add table
Reference in a new issue