diff --git a/src/data_source.rs b/src/data_source.rs index 754f050..7edbc48 100644 --- a/src/data_source.rs +++ b/src/data_source.rs @@ -1,10 +1,10 @@ +use crate::ChampInfo; use indexmap::IndexMap; use log::{error, info}; use serde_derive::{Deserialize, Serialize}; use serde_json::Value; use std::fs; use std::path::PathBuf; -use crate::ChampInfo; #[derive(Serialize, Deserialize)] struct ItemSet { diff --git a/src/main.rs b/src/main.rs index f062952..0a7783a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,7 @@ struct Champion { pub struct ChampInfo { id: String, name: String, - key: String + key: String, } const USER_AGENT_KEY: &str = "User-Agent"; @@ -105,7 +105,6 @@ fn main() { if !champion.data.contains_key(&champ_id) { champ_id = get_champ_from_key(&champion, &champ_id); } - if champion.data.contains_key(&champ_id) { let path = lol_champs_dir.join(&champ_id).join("Recommended"); fs::create_dir_all(&path).unwrap(); @@ -126,7 +125,7 @@ fn main() { } } -fn get_champ_from_key(champs: &Champion, key: &str) -> String { +fn get_champ_from_key(champs: &Champion, key: &str) -> String { for champ in champs.data.values() { if key == champ.key { return champ.id.clone();