From 5385c0f4ed9708fd3bbf82b49a4a85f134a2f5d4 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 12 Feb 2026 23:21:59 +0300 Subject: [PATCH] cli: wire shelve flag; more clippy fixes Signed-off-by: NotAShelf Change-Id: I694da71afe93bcb33687ff7d8e75f04f6a6a6964 --- src/cli/commands/export.rs | 2 +- src/cli/commands/fetch.rs | 4 ++-- src/cli/commands/fork.rs | 11 +++++------ src/cli/commands/import.rs | 17 ++++++++++------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/cli/commands/export.rs b/src/cli/commands/export.rs index 8528a45..6861553 100644 --- a/src/cli/commands/export.rs +++ b/src/cli/commands/export.rs @@ -35,7 +35,7 @@ pub async fn execute( let config_dir = config_path.parent().unwrap_or(Path::new(".")); // IPC coordination - prevent concurrent operations on the same modpack - let ipc = IpcCoordinator::new(&config_dir.to_path_buf())?; + let ipc = IpcCoordinator::new(config_dir)?; let ipc_timeout = std::time::Duration::from_secs(60); // Check for conflicting export operations diff --git a/src/cli/commands/fetch.rs b/src/cli/commands/fetch.rs index bdea8f7..9b88b1d 100644 --- a/src/cli/commands/fetch.rs +++ b/src/cli/commands/fetch.rs @@ -37,8 +37,8 @@ pub async fn execute( let operation_id = coordinator.register_operation(OperationType::Fetch)?; let _guard = OperationGuard::new(coordinator, operation_id); - // Create fetcher - let fetcher = Fetcher::new("."); + // Create fetcher with shelve option + let fetcher = Fetcher::new(".").with_shelve(args.shelve); // Fetch all projects (progress indicators handled in fetch.rs) fetcher.fetch_all(&lockfile, &config).await?; diff --git a/src/cli/commands/fork.rs b/src/cli/commands/fork.rs index 1627dc3..1d18966 100644 --- a/src/cli/commands/fork.rs +++ b/src/cli/commands/fork.rs @@ -211,13 +211,12 @@ fn execute_init( .args(["log", "--limit", "1", "--template", ""]) .current_dir(path) .output() + && !output.stdout.is_empty() { - if !output.stdout.is_empty() { - println!( - "Note: Jujutsu repository detected. Make sure to run 'jj git \ - push' to sync changes with remote if needed." - ); - } + println!( + "Note: Jujutsu repository detected. Make sure to run 'jj git \ + push' to sync changes with remote if needed." + ); } }, VcsType::None => { diff --git a/src/cli/commands/import.rs b/src/cli/commands/import.rs index cb6649c..c9a20da 100644 --- a/src/cli/commands/import.rs +++ b/src/cli/commands/import.rs @@ -134,16 +134,19 @@ async fn import_modrinth( { log::info!("Fetching project: {project_id}"); match platform - .request_project_with_files(project_id, &lockfile.mc_versions, &[ - loader.0.clone(), - ]) + .request_project_with_files( + project_id, + &lockfile.mc_versions, + std::slice::from_ref(&loader.0), + ) .await { Ok(mut project) => { // Select best file - if let Err(e) = - project.select_file(&lockfile.mc_versions, &[loader.0.clone()]) - { + if let Err(e) = project.select_file( + &lockfile.mc_versions, + std::slice::from_ref(&loader.0), + ) { log::warn!( "Failed to select file for {}: {}", project.get_name(), @@ -357,7 +360,7 @@ async fn import_curseforge( description: None, author: manifest["author"] .as_str() - .map(|s| s.to_string()), + .map(std::string::ToString::to_string), overrides: vec!["overrides".to_string()], server_overrides: None, client_overrides: None,