From 096bd2df046b06f9466829b91c8aeae94b0e053d Mon Sep 17 00:00:00 2001 From: Alexander Kiselev Date: Sun, 22 Feb 2026 15:59:47 -0800 Subject: [PATCH] fix: resolve fmt check and drop-of-reference warnings - Fix rustfmt issue in tests/common/mod.rs (single-line .context() chain) - Remove stale drop(harness) calls that now drop &'static references - Use _harness for unused bindings that only ensure bridge initialization Co-Authored-By: Claude Opus 4.6 --- tests/common/mod.rs | 3 +-- tests/symbol_tests.rs | 8 ++------ tests/type_tests.rs | 18 ++++-------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 85e1609..eca05a2 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -188,8 +188,7 @@ impl DaemonTestHarness { .join(project); // Load config to find Ghidra installation - let config = ghidra_cli::config::Config::load() - .context("Failed to load config")?; + let config = ghidra_cli::config::Config::load().context("Failed to load config")?; let ghidra_install_dir = config .ghidra_install_dir .clone() diff --git a/tests/symbol_tests.rs b/tests/symbol_tests.rs index 10a88d6..a4bebc2 100644 --- a/tests/symbol_tests.rs +++ b/tests/symbol_tests.rs @@ -27,7 +27,7 @@ fn harness() -> &'static DaemonTestHarness { #[serial] fn test_symbol_list() { require_ghidra!(); - let harness = harness(); + let _harness = harness(); let output = Command::cargo_bin("ghidra") .unwrap() @@ -50,8 +50,6 @@ fn test_symbol_list() { "symbol list should contain main. Output: {}", stdout ); - - drop(harness); } #[test] @@ -147,7 +145,7 @@ fn test_symbol_rename() { #[serial] fn test_symbol_get_nonexistent() { require_ghidra!(); - let harness = harness(); + let _harness = harness(); Command::cargo_bin("ghidra") .unwrap() @@ -160,6 +158,4 @@ fn test_symbol_get_nonexistent() { .arg(TEST_PROGRAM) .assert() .failure(); - - drop(harness); } diff --git a/tests/type_tests.rs b/tests/type_tests.rs index 73ff275..8ef8d38 100644 --- a/tests/type_tests.rs +++ b/tests/type_tests.rs @@ -25,7 +25,7 @@ fn harness() -> &'static DaemonTestHarness { #[serial] fn test_type_list() { require_ghidra!(); - let harness = harness(); + let _harness = harness(); Command::cargo_bin("ghidra") .unwrap() @@ -37,15 +37,13 @@ fn test_type_list() { .arg(TEST_PROGRAM) .assert() .success(); - - drop(harness); } #[test] #[serial] fn test_type_get_primitive() { require_ghidra!(); - let harness = harness(); + let _harness = harness(); Command::cargo_bin("ghidra") .unwrap() @@ -59,15 +57,13 @@ fn test_type_get_primitive() { .assert() .success() .stdout(predicate::str::contains("size")); - - drop(harness); } #[test] #[serial] fn test_type_create() { require_ghidra!(); - let harness = harness(); + let _harness = harness(); Command::cargo_bin("ghidra") .unwrap() @@ -94,8 +90,6 @@ fn test_type_create() { .assert() .success() .stdout(predicate::str::contains("MyTestStruct")); - - drop(harness); } #[test] @@ -128,15 +122,13 @@ fn test_type_apply() { "Expected success or instruction conflict, got: {}", stderr ); - - drop(harness); } #[test] #[serial] fn test_type_get_nonexistent() { require_ghidra!(); - let harness = harness(); + let _harness = harness(); Command::cargo_bin("ghidra") .unwrap() @@ -149,6 +141,4 @@ fn test_type_get_nonexistent() { .arg(TEST_PROGRAM) .assert() .failure(); - - drop(harness); }