diff --git a/src/cgg_data_source.rs b/src/cgg_data_source.rs index 3e78ba1..2bed04f 100644 --- a/src/cgg_data_source.rs +++ b/src/cgg_data_source.rs @@ -125,19 +125,19 @@ impl DataSource for CGGDataSource { CHAMPIONS_STATS .lock() .unwrap() - .insert(entry.0.clone(), entry.1.clone()); + .insert(entry.0.to_owned(), entry.1.to_owned()); } - let patch = datas.lol.champions_report[0].patch.clone(); + let patch = datas.lol.champions_report[0].patch.to_owned(); let mut champions: IndexMap> = IndexMap::new(); for champ in &datas.lol.champions_report { let id = champ.champion_id.to_string(); if champions.contains_key(&id) { - let mut roles = champions.get(&id).unwrap().clone(); - roles.push(champ.role.clone()); + let mut roles = champions.get(&id).unwrap().to_owned(); + roles.push(champ.role.to_owned()); champions.insert(id, roles); } else { - champions.insert(id, vec![champ.role.clone()]); + champions.insert(id, vec![champ.role.to_owned()]); } } @@ -193,7 +193,7 @@ impl DataSource for CGGDataSource { let champs_stats = CHAMPIONS_STATS.lock().unwrap(); for val in champs_stats.values() { if val.champion_id.is_some() && val.champion_id.unwrap() == champ.champion_id { - key = val.stats.as_ref().unwrap().id.clone(); + key = val.stats.as_ref().unwrap().id.to_owned(); } } diff --git a/src/main.rs b/src/main.rs index 054ca9e..b95df97 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,7 +102,7 @@ fn main() { ); for (id, positions) in &champs { - let mut champ_id: String = String::from(id); + let mut champ_id: String = id.to_owned(); if !champion.data.contains_key(&champ_id) { champ_id = get_champ_from_key(&champion, &champ_id); @@ -134,7 +134,7 @@ fn main() { fn get_champ_from_key(champs: &Champion, key: &str) -> String { for champ in champs.data.values() { if key == champ.key { - return champ.id.clone(); + return champ.id.to_owned(); } } String::new()