treewide: fix clippy lints
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I411be69ff31f9cb39cd4cdebc8985b366a6a6964
This commit is contained in:
parent
b93b234fc2
commit
61ced09d25
43 changed files with 558 additions and 464 deletions
|
|
@ -12,7 +12,7 @@ use crate::{
|
|||
},
|
||||
};
|
||||
|
||||
pub async fn execute(
|
||||
pub fn execute(
|
||||
args: InitArgs,
|
||||
global_yes: bool,
|
||||
lockfile_path: &Path,
|
||||
|
|
@ -125,7 +125,7 @@ pub async fn execute(
|
|||
};
|
||||
|
||||
// Save expects directory path, so get parent directory
|
||||
let lockfile_dir = lockfile_path.parent().unwrap_or(Path::new("."));
|
||||
let lockfile_dir = lockfile_path.parent().unwrap_or_else(|| Path::new("."));
|
||||
lockfile.save(lockfile_dir)?;
|
||||
|
||||
let config = Config {
|
||||
|
|
@ -143,7 +143,7 @@ pub async fn execute(
|
|||
file_count_preference: None,
|
||||
};
|
||||
|
||||
let config_dir = config_path.parent().unwrap_or(Path::new("."));
|
||||
let config_dir = config_path.parent().unwrap_or_else(|| Path::new("."));
|
||||
config.save(config_dir)?;
|
||||
|
||||
println!("Initialized new modpack '{name}' v{version}");
|
||||
|
|
@ -161,10 +161,8 @@ pub async fn execute(
|
|||
|
||||
// Check if CurseForge API key is needed and prompt if interactive
|
||||
if is_interactive && (target == "curseforge" || target == "multiplatform") {
|
||||
let credentials = ResolvedCredentials::load().ok();
|
||||
let has_cf_key = credentials
|
||||
.as_ref()
|
||||
.is_some_and(|c| c.curseforge_api_key().is_some());
|
||||
let credentials = ResolvedCredentials::load();
|
||||
let has_cf_key = credentials.curseforge_api_key().is_some();
|
||||
|
||||
if !has_cf_key {
|
||||
println!();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue