From da71f11855190ddc6d2f039830cd21cd0431fd93 Mon Sep 17 00:00:00 2001 From: nyyu Date: Mon, 15 Mar 2021 23:11:40 +0100 Subject: [PATCH] lint --- src/cgg_data_source.rs | 4 ++-- src/data_source.rs | 6 +++--- src/kb_data_source.rs | 4 ++-- src/main.rs | 6 +++--- src/pb_data_source.rs | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cgg_data_source.rs b/src/cgg_data_source.rs index fde347a..2fe8787 100644 --- a/src/cgg_data_source.rs +++ b/src/cgg_data_source.rs @@ -146,7 +146,7 @@ impl DataSource for CGGDataSource { fn get_champ_data_with_win_pourcentage( &self, champ: &ChampInfo, - positions: &Vec, + positions: &[String], _client: &ureq::Agent, ) -> Vec<(String, Vec, Stat)> { let mut data = vec![]; @@ -155,7 +155,7 @@ impl DataSource for CGGDataSource { let reports = CHAMPIONS_REPORT.lock().unwrap(); for champion in reports.iter() { if champion.champion_id.to_string() == champ.key - && champion.role == position.to_owned() + && champion.role == *position { some_champ = Some(champion); break; diff --git a/src/data_source.rs b/src/data_source.rs index 1fd83c2..916354a 100644 --- a/src/data_source.rs +++ b/src/data_source.rs @@ -50,14 +50,14 @@ pub trait DataSource { fn get_champ_data_with_win_pourcentage( &self, champ: &ChampInfo, - positions: &Vec, + positions: &[String], client: &ureq::Agent, ) -> Vec<(String, Vec, Stat)>; fn write_item_set( &self, champ: &ChampInfo, - positions: &Vec, + positions: &[String], ver: &str, path: &PathBuf, client: &ureq::Agent, @@ -73,7 +73,7 @@ pub trait DataSource { for pos in positions { let mut ok = false; for build in &data { - if build.0 == pos.to_owned() { + if build.0 == *pos { ok = true; break; } diff --git a/src/kb_data_source.rs b/src/kb_data_source.rs index e55bfb0..d243f9f 100644 --- a/src/kb_data_source.rs +++ b/src/kb_data_source.rs @@ -316,7 +316,7 @@ impl DataSource for KBDataSource { fn get_champ_data_with_win_pourcentage( &self, champ: &ChampInfo, - position: &Vec, + position: &[String], client: &ureq::Agent, ) -> Vec<(String, Vec, Stat)> { let mut champ_data = vec![]; @@ -346,7 +346,7 @@ impl DataSource for KBDataSource { let mut build: Option<&KBBuild> = None; for b in &data.builds2 { - if b.position.to_uppercase() == pos.to_owned() { + if b.position.to_uppercase() == *pos { build = Some(b); break; } diff --git a/src/main.rs b/src/main.rs index d9c5e7a..05bbf2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -185,9 +185,9 @@ fn get_and_write_item_set( client: &ureq::Agent, champion: &Champion, lol_champs_dir: &PathBuf, - patch: &String, - id: &String, - positions: &Vec, + patch: &str, + id: &str, + positions: &[String], ) { let mut champ_id: String = id.to_owned(); diff --git a/src/pb_data_source.rs b/src/pb_data_source.rs index e2ba7f8..615189b 100644 --- a/src/pb_data_source.rs +++ b/src/pb_data_source.rs @@ -24,7 +24,7 @@ impl DataSource for PBDataSource { fn get_champ_data_with_win_pourcentage( &self, _champ: &ChampInfo, - _positions: &Vec, + _positions: &[String], _client: &ureq::Agent, ) -> Vec<(String, Vec, Stat)> { vec![]