diff --git a/src/bin/minimon.rs b/src/bin/minimon.rs index da57c34..4f5ddfa 100644 --- a/src/bin/minimon.rs +++ b/src/bin/minimon.rs @@ -13,7 +13,7 @@ fn main() { let mut rng = SmallRng::from_entropy(); if let Some(random_file) = files.choose(&mut rng) { - println!("{}", random_file); + println!("{random_file}"); if let Some(file_data) = ColorScriptsDir::get(random_file) { println!("{}", std::str::from_utf8(file_data.data.as_ref()).unwrap()); } diff --git a/src/main.rs b/src/main.rs index 63221da..59feefd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,7 +30,7 @@ fn main() { // display selections println!("Extract destination: {}", extract_destination.display()); - println!("Verbose: {}", verbose); + println!("Verbose: {verbose}"); // invoke bigchungus fetch function rustmon::fetch::fetch(extract_destination, verbose) @@ -44,9 +44,9 @@ fn main() { if pokemon_name.is_empty() { // list match rustmon::list::print_pokemon_list() { - Ok(_) => {} + Ok(()) => {} Err(e) => { - eprintln!("Error: {}", e); + eprintln!("Error: {e}"); std::process::exit(1); } } @@ -55,7 +55,7 @@ fn main() { match rustmon::list::print_pokemon_forms(pokemon_name) { Ok(_) => {} Err(e) => { - eprintln!("Error: {}", e); + eprintln!("Error: {e}"); std::process::exit(1); } } diff --git a/src/print.rs b/src/print.rs index 313b466..a6cc97f 100644 --- a/src/print.rs +++ b/src/print.rs @@ -26,7 +26,9 @@ pub fn print( random_lite().unwrap(); } else { // convert list of names to list of pokedex numbers - let pokedexes = if !names[0].is_empty() { + let pokedexes = if names[0].is_empty() { + pokedexes.clone() + } else { let mut pokedexes: Vec = Vec::new(); for name in names { match find_pokedex_by_pokemon(name) { @@ -38,8 +40,6 @@ pub fn print( } } pokedexes - } else { - pokedexes.clone() }; // process the pokedexes list @@ -182,7 +182,7 @@ fn process_forms_list(pokedexes: &[u16], forms: Vec<&String>) -> Vec { // consider using crate::list::print_pokemon_forms(pokemon_name) println!("Available forms for {}:", pokemon.name); for available_form in &pokemon.forms { - println!(" - {}", available_form); + println!(" - {available_form}"); } std::process::exit(1); } @@ -223,7 +223,7 @@ fn slug_generator(big: bool, form: String, name: String, shiny_rate: f32) -> std path.push(crate::constants::DATA_DIRECTORY.join("colorscripts")); path.push(&big); path.push(shiny_directory); - path.push(format!("{}{}", name, form)); + path.push(format!("{name}{form}")); path } diff --git a/src/validation.rs b/src/validation.rs index fe78055..8308645 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -2,7 +2,7 @@ pub fn validate_files() { match validate_pokemon_json() { Ok(_) => {} Err(e) => { - eprintln!("Error: {}", e); + eprintln!("Error: {e}"); std::process::exit(1); } }; @@ -10,7 +10,7 @@ pub fn validate_files() { match validate_colorscripts_directory() { Ok(_) => {} Err(e) => { - eprintln!("Error: {}", e); + eprintln!("Error: {e}"); std::process::exit(1); } };