From 81ba3b645b8f656bbc08ed34d15148ae979a957c Mon Sep 17 00:00:00 2001 From: jiangjianfeng Date: Fri, 6 Jun 2025 06:29:57 +0000 Subject: [PATCH] Execute clippy command in the kernel crate directory --- osdk/src/base_crate/mod.rs | 1 + osdk/src/commands/mod.rs | 24 +++--------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/osdk/src/base_crate/mod.rs b/osdk/src/base_crate/mod.rs index 2d44d21a..8cbdb3ec 100644 --- a/osdk/src/base_crate/mod.rs +++ b/osdk/src/base_crate/mod.rs @@ -51,6 +51,7 @@ pub enum BaseCrateType { /// The base crate is for testing the target crate. Test, /// The base crate is for other actions using Cargo. + #[expect(unused)] Other, } diff --git a/osdk/src/commands/mod.rs b/osdk/src/commands/mod.rs index a4893306..48aa1cec 100644 --- a/osdk/src/commands/mod.rs +++ b/osdk/src/commands/mod.rs @@ -10,8 +10,6 @@ mod run; mod test; mod util; -use util::DEFAULT_TARGET_RELPATH; - pub use self::{ build::execute_build_command, debug::execute_debug_command, new::execute_new_command, profile::execute_profile_command, run::execute_run_command, test::execute_test_command, @@ -19,9 +17,8 @@ pub use self::{ use crate::{ arch::get_default_arch, - base_crate::{new_base_crate, BaseCrateType}, error_msg, - util::{get_current_crates, get_target_directory, DirGuard}, + util::{get_current_crates, DirGuard}, }; /// Execute the forwarded cargo command with arguments. @@ -65,24 +62,9 @@ pub fn execute_forwarded_command_on_each_crate( args: &Vec, cfg_ktest: bool, ) { - let cargo_target_directory = get_target_directory(); - let osdk_output_directory = cargo_target_directory.join(DEFAULT_TARGET_RELPATH); - let target_crates = get_current_crates(); for target in target_crates { - if !target.is_kernel_crate { - let _dir_guard = DirGuard::change_dir(target.path); - execute_forwarded_command(subcommand, args, cfg_ktest); - } else { - let base_crate_path = new_base_crate( - BaseCrateType::Other, - osdk_output_directory.join(&target.name), - &target.name, - target.path, - false, - ); - let _dir_guard = DirGuard::change_dir(&base_crate_path); - execute_forwarded_command(subcommand, args, cfg_ktest); - } + let _dir_guard = DirGuard::change_dir(target.path); + execute_forwarded_command(subcommand, args, cfg_ktest); } }