fix clippy errors
This commit is contained in:
parent
562bedbcbf
commit
57f80ebde2
1 changed files with 23 additions and 28 deletions
|
@ -86,7 +86,7 @@ impl CGGDataSource {
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join("");
|
.join("");
|
||||||
|
|
||||||
self.make_item_set(build, [label, &key_order.as_str()].join(" ").as_str())
|
self.make_item_set(build, [label, key_order.as_str()].join(" ").as_str())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,10 +113,10 @@ impl DataSource for CGGDataSource {
|
||||||
let page = &req.into_string().unwrap();
|
let page = &req.into_string().unwrap();
|
||||||
|
|
||||||
let datas: BuildResponse =
|
let datas: BuildResponse =
|
||||||
serde_json::from_str(&extract_json("window.__PRELOADED_STATE__ = ", &page)).unwrap();
|
serde_json::from_str(&extract_json("window.__PRELOADED_STATE__ = ", page)).unwrap();
|
||||||
|
|
||||||
let champs_stats: HashMap<String, ChampStat> =
|
let champs_stats: HashMap<String, ChampStat> =
|
||||||
serde_json::from_str(&extract_json("window.__FLASH_CMS_APOLLO_STATE__ = ", &page))
|
serde_json::from_str(&extract_json("window.__FLASH_CMS_APOLLO_STATE__ = ", page))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
for entry in champs_stats.iter() {
|
for entry in champs_stats.iter() {
|
||||||
CHAMPIONS_STATS
|
CHAMPIONS_STATS
|
||||||
|
@ -161,33 +161,28 @@ impl DataSource for CGGDataSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(champ) = some_champ {
|
if let Some(champ) = some_champ {
|
||||||
let mut blocks = vec![];
|
let blocks = vec![
|
||||||
|
self.make_item_set_from_list(
|
||||||
blocks.push(self.make_item_set_from_list(
|
&champ.stats.starting_items,
|
||||||
&champ.stats.starting_items,
|
"Highest % Win Starting Items | Skills: ",
|
||||||
"Highest % Win Starting Items | Skills: ",
|
&champ.stats.skills,
|
||||||
&champ.stats.skills,
|
),
|
||||||
));
|
|
||||||
blocks.push(
|
|
||||||
self.make_item_set(&champ.stats.core_builds, "Highest % Win Core Build Path:"),
|
self.make_item_set(&champ.stats.core_builds, "Highest % Win Core Build Path:"),
|
||||||
);
|
|
||||||
blocks.push(
|
|
||||||
self.make_item_set(&champ.stats.big_item_builds, "Highest % Win Big Items:"),
|
self.make_item_set(&champ.stats.big_item_builds, "Highest % Win Big Items:"),
|
||||||
);
|
self.make_item_set_from_list(
|
||||||
|
&champ.stats.most_common_starting_items,
|
||||||
blocks.push(self.make_item_set_from_list(
|
"Most Frequent Starting Items | Skills: ",
|
||||||
&champ.stats.most_common_starting_items,
|
&champ.stats.most_common_skills,
|
||||||
"Most Frequent Starting Items | Skills: ",
|
),
|
||||||
&champ.stats.most_common_skills,
|
self.make_item_set(
|
||||||
));
|
&champ.stats.most_common_core_builds,
|
||||||
blocks.push(self.make_item_set(
|
"Most Frequent Build Path",
|
||||||
&champ.stats.most_common_core_builds,
|
),
|
||||||
"Most Frequent Build Path",
|
self.make_item_set(
|
||||||
));
|
&champ.stats.most_common_big_item_builds,
|
||||||
blocks.push(self.make_item_set(
|
"Most Frequent Big Items:",
|
||||||
&champ.stats.most_common_big_item_builds,
|
),
|
||||||
"Most Frequent Big Items:",
|
];
|
||||||
));
|
|
||||||
|
|
||||||
let mut key: String = String::new();
|
let mut key: String = String::new();
|
||||||
let champs_stats = CHAMPIONS_STATS.lock().unwrap();
|
let champs_stats = CHAMPIONS_STATS.lock().unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue