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

@ -44,6 +44,14 @@ fn get_loaders(lockfile: &LockFile) -> Vec<String> {
lockfile.loaders.keys().cloned().collect()
}
#[expect(
clippy::future_not_send,
reason = "not required to be Send; only called from single-threaded context"
)]
#[expect(
clippy::too_many_arguments,
reason = "CLI command handler maps directly from clap args"
)]
pub async fn execute(
cf_arg: Option<String>,
mr_arg: Option<String>,
@ -71,8 +79,8 @@ pub async fn execute(
log::info!("Adding project with explicit platform specification");
// Load lockfile
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("."));
let mut lockfile = LockFile::load(lockfile_dir)?;
@ -258,7 +266,7 @@ pub async fn execute(
if !no_deps {
log::info!("Resolving dependencies...");
let platforms = create_all_platforms()?;
let platforms = create_all_platforms();
let mut resolver = DependencyResolver::new();
let deps = resolver
@ -304,7 +312,7 @@ pub async fn execute(
}
fn create_all_platforms()
-> Result<HashMap<String, Box<dyn crate::platform::PlatformClient>>> {
-> HashMap<String, Box<dyn crate::platform::PlatformClient>> {
let mut platforms = HashMap::new();
if let Ok(platform) = create_platform("modrinth", None) {
@ -321,7 +329,7 @@ fn create_all_platforms()
platforms.insert("github".to_string(), platform);
}
Ok(platforms)
platforms
}
#[cfg(test)]