diff --git a/src/pb_data_source.rs b/src/pb_data_source.rs index abfc45b..728c435 100644 --- a/src/pb_data_source.rs +++ b/src/pb_data_source.rs @@ -15,8 +15,7 @@ struct ChampionResponse { #[derive(Deserialize, Debug)] struct Champion { - key: String, - name: String, + key: Option, } impl DataSource for PBDataSource { @@ -42,7 +41,9 @@ impl DataSource for PBDataSource { let data: ChampionResponse = serde_json::from_str(&page).unwrap(); for champ in data.champions { - champs.insert(champ.key.parse::().unwrap(), vec!["ANY".to_owned()]); + if let Some(k) = champ.key { + champs.insert(k.parse::().unwrap(), vec!["ANY".to_owned()]); + } } champs