Clippy fixes

This commit is contained in:
2022-08-29 22:59:53 -07:00
parent bac49bc766
commit 35828e4b5b
2 changed files with 6 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ impl From<&str> for AmongUsVersion {
// Ignore a prepending "v"
let tmp_str = s.replace("v", "");
let v: Vec<&str> = tmp_str.split(".").collect();
let v: Vec<&str> = tmp_str.split('.').collect();
AmongUsVersion {
year: i32::from_str_radix(v[0], 10).unwrap(),

View File

@@ -210,7 +210,7 @@ async fn main() {
let version_smash = format!(
"{}-{}",
among_us_version.to_string().clone(),
among_us_version,
ver_url.0.clone()
);
let new_installed_path: PathBuf = [installs_path.to_str().unwrap(), version_smash.as_str()]
@@ -247,7 +247,7 @@ async fn main() {
fs::rename(among_us_path, new_installed_path.clone()).unwrap();
let mut download_path = data_path.clone();
let downloaded_filename = ver_url.1.rsplit("/").nth(0).unwrap();
let downloaded_filename = ver_url.1.rsplit('/').next().unwrap();
download_path.push(downloaded_filename.clone());
if !Path::exists(&download_path) {
@@ -269,7 +269,7 @@ async fn main() {
let mut root_folder_path = String::new();
for i in archive.file_names() {
root_folder_path = String::from(i.split("/").nth(0).unwrap());
root_folder_path = String::from(i.split('/').next().unwrap());
break;
}
let extracted_path: PathBuf = [data_path.to_str().unwrap(), root_folder_path.as_str(), "."]
@@ -299,7 +299,7 @@ async fn main() {
for i in &collection {
let existing_ver_smash = i.as_ref().unwrap().file_name();
let mut ver_smash_split = existing_ver_smash.to_str().unwrap().split("-");
let mut ver_smash_split = existing_ver_smash.to_str().unwrap().split('-');
let auv = ver_smash_split.next().unwrap();
if !auv_array.contains(&auv.to_string()) {
let label_text = format!("Among Us {}", auv);
@@ -316,7 +316,7 @@ async fn main() {
for i in collection {
let existing_ver_smash = i.unwrap().file_name();
let mut ver_smash_split = existing_ver_smash.to_str().unwrap().split("-");
let mut ver_smash_split = existing_ver_smash.to_str().unwrap().split('-');
let auv = ver_smash_split.next().unwrap();
let button_string: String = format!("Town of Us {}", ver_smash_split.next().unwrap());