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

@ -12,7 +12,7 @@ fn get_loaders(lockfile: &LockFile) -> Vec<String> {
}
pub fn create_all_platforms()
-> Result<HashMap<String, Box<dyn crate::platform::PlatformClient>>> {
-> HashMap<String, Box<dyn crate::platform::PlatformClient>> {
const MODRINTH: &str = "modrinth";
const CURSEFORGE: &str = "curseforge";
@ -27,7 +27,7 @@ pub fn create_all_platforms()
platforms.insert(CURSEFORGE.to_owned(), platform);
}
Ok(platforms)
platforms
}
async fn resolve_input(
@ -55,6 +55,10 @@ use std::path::Path;
use crate::{cli::AddArgs, model::fork::LocalConfig};
#[expect(
clippy::future_not_send,
reason = "not required to be Send; only called from single-threaded context"
)]
pub async fn execute(
args: AddArgs,
global_yes: bool,
@ -66,8 +70,8 @@ pub async fn execute(
// Load lockfile
// Load expects directory path, so get parent directory
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("."));
// Check if lockfile exists (try both pakker-lock.json and pakku-lock.json)
let lockfile_exists =
@ -110,7 +114,7 @@ pub async fn execute(
let parent_lockfile = parent_paths
.iter()
.find(|path| path.exists())
.and_then(|path| LockFile::load(path.parent().unwrap()).ok())
.and_then(|path| LockFile::load(path.parent()?).ok())
.ok_or_else(|| {
PakkerError::IoError(std::io::Error::new(
std::io::ErrorKind::NotFound,
@ -141,7 +145,7 @@ pub async fn execute(
let _config = Config::load(config_dir).ok();
// Create platforms
let platforms = create_all_platforms()?;
let platforms = create_all_platforms();
let mut new_projects = Vec::new();
let mut errors = MultiError::new();