diff --git a/src/main.rs b/src/main.rs index 320f63c..18277e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -307,7 +307,7 @@ async fn actual_main(mut cli_app: Ferium) -> Result<()> { .await { return Err( - if err.to_string() == ferinth::Error::InvalidIDorSlug.to_string() { + if let Some(&ferinth::Error::InvalidIDorSlug) = err.downcast_ref() { anyhow!("Invalid identifier") } else { err diff --git a/src/subcommands/modpack/delete.rs b/src/subcommands/modpack/delete.rs index e0850ec..c0f03c9 100644 --- a/src/subcommands/modpack/delete.rs +++ b/src/subcommands/modpack/delete.rs @@ -18,7 +18,7 @@ pub fn delete( config .modpacks .iter() - .position(|modpack| modpack.name == modpack_name) + .position(|modpack| modpack.name.eq_ignore_ascii_case(&modpack_name)) .context("The modpack name provided does not exist")? } else { let modpack_names = config diff --git a/src/subcommands/modpack/switch.rs b/src/subcommands/modpack/switch.rs index 8422385..2a98900 100644 --- a/src/subcommands/modpack/switch.rs +++ b/src/subcommands/modpack/switch.rs @@ -14,7 +14,7 @@ pub fn switch(config: &mut Config, modpack_name: Option) -> Result<()> { match config .modpacks .iter() - .position(|modpack| modpack.name == modpack_name) + .position(|modpack| modpack.name.eq_ignore_ascii_case(&modpack_name)) { Some(selection) => { config.active_modpack = selection; diff --git a/src/subcommands/profile/switch.rs b/src/subcommands/profile/switch.rs index 3ca95a8..fb01e18 100644 --- a/src/subcommands/profile/switch.rs +++ b/src/subcommands/profile/switch.rs @@ -13,7 +13,7 @@ pub fn switch(config: &mut Config, profile_name: Option) -> Result<()> { match config .profiles .iter() - .position(|profile| profile.name == profile_name) + .position(|profile| profile.name.eq_ignore_ascii_case(&profile_name)) { Some(selection) => { config.active_profile = selection; diff --git a/src/subcommands/upgrade.rs b/src/subcommands/upgrade.rs index bfc13d5..778fb62 100644 --- a/src/subcommands/upgrade.rs +++ b/src/subcommands/upgrade.rs @@ -115,7 +115,11 @@ pub async fn upgrade(profile: &Profile) -> Result<()> { for file in read_dir(profile.output_dir.join("user"))? { let file = file?; let path = file.path(); - if path.is_file() && path.extension().is_some_and(|ext| ext == "jar") { + if path.is_file() + && path + .extension() + .is_some_and(|ext| ext.eq_ignore_ascii_case("jar")) + { to_install.push((file.file_name(), path)); } }