Re-designs the menu to be more intuitive + App detection #27
Annotations
2 warnings
this boolean expression can be simplified:
protonup-rs/src/main.rs#L258
warning: this boolean expression can be simplified
--> protonup-rs/src/main.rs:258:9
|
258 | / !(install_dirs
259 | | .iter()
260 | | .any(|install_dir| files::check_if_exists(install_dir, tag_name))
261 | | && !confirm_menu(
... |
264 | | false,
265 | | ))
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
help: try
|
258 ~ !install_dirs
259 + .iter()
260 + .any(|install_dir| files::check_if_exists(install_dir, tag_name)) || confirm_menu(
261 + format!("Version {tag_name} exists in the installation path. Overwrite?"),
262 + String::from("If you choose yes, you will re-install it."),
263 + false,
264 + )
|
|
unneeded late initialization:
protonup-rs/src/main.rs#L68
warning: unneeded late initialization
--> protonup-rs/src/main.rs:68:5
|
68 | let source: variants::VariantParameters;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: declare `source` here
|
176| let source: variants::VariantParameters = if source_options.len() == 1 {
| +++++++++++++++++++++++++++++++++++++++++
help: remove the assignments from the branches
|
177~ source_options[0].parameters()
178| } else {
179~ Select::new("Chose the variant you want to install:", source_options)
180| .prompt()
181| .map(|variant| variant.parameters())
182~ .unwrap_or_else(|_| std::process::exit(0))
|
|