treewide: fix clippy lints

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I411be69ff31f9cb39cd4cdebc8985b366a6a6964
This commit is contained in:
raf 2026-04-21 18:08:41 +03:00
commit 61ced09d25
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
43 changed files with 558 additions and 464 deletions

View file

@ -9,6 +9,7 @@ use crate::{
utils::hash::compute_sha256_bytes,
};
#[expect(clippy::future_not_send, reason = "not required to be Send")]
pub async fn execute(
args: ExportArgs,
lockfile_path: &Path,
@ -31,8 +32,8 @@ pub async fn execute(
log::info!("IO errors will be shown during export");
}
let lockfile_dir = lockfile_path.parent().unwrap_or(Path::new("."));
let config_dir = config_path.parent().unwrap_or(Path::new("."));
let lockfile_dir = lockfile_path.parent().unwrap_or_else(|| Path::new("."));
let config_dir = config_path.parent().unwrap_or_else(|| Path::new("."));
// IPC coordination - prevent concurrent operations on the same modpack
let ipc = IpcCoordinator::new(config_dir)?;
@ -113,7 +114,7 @@ pub async fn execute(
LockFile::load_with_validation(lockfile_dir, false)?;
// Merge: start with parent, override with local
merge_lockfiles(parent_lockfile, local_lockfile, local_cfg)?
merge_lockfiles(parent_lockfile, &local_lockfile, local_cfg)
} else {
log::info!("No local lockfile - using parent lockfile");
parent_lockfile
@ -188,7 +189,7 @@ pub async fn execute(
};
// Create exporter
let mut exporter = Exporter::new(".");
let exporter = Exporter::new(".");
// Export based on profile argument
if let Some(profile_name) = args.profile {
@ -197,7 +198,7 @@ pub async fn execute(
.export(&profile_name, &lockfile, &config, Path::new(output_path))
.await?;
println!("Export complete: {output_file:?}");
println!("Export complete: {}", output_file.display());
} else {
// Multi-profile export (Pakker-compatible default behavior)
let output_files = exporter
@ -206,7 +207,7 @@ pub async fn execute(
println!("\nExported {} files:", output_files.len());
for output_file in output_files {
println!(" - {output_file:?}");
println!(" - {}", output_file.display());
}
}
@ -218,9 +219,9 @@ pub async fn execute(
/// with same slug
fn merge_lockfiles(
parent: LockFile,
local: LockFile,
local: &LockFile,
local_config: &LocalConfig,
) -> Result<LockFile> {
) -> LockFile {
let mut merged = LockFile {
target: parent.target, // Use parent target
mc_versions: parent.mc_versions, // Use parent MC versions
@ -298,5 +299,5 @@ fn merge_lockfiles(
merged.projects.len()
);
Ok(merged)
merged
}