Skip to content

Commit 3d230a6

Browse files
committed
fix: resolve compilation errors in uuproc tests and add Windows dependencies
- Fix E0425 errors in test_uuproc.rs by removing leading underscores from variable names - Line 464: _empty_cmdline -> empty_cmdline (used in Linux-specific assertion) - Line 640: _processes -> processes (used in Linux-specific assertion) - Add missing winapi dependency for Windows platform - Add winapi 0.3 with tlhelp32 and minwindef features to Cargo.toml - Resolves E0433 errors for unresolved winapi imports in windows.rs
1 parent 5a45edf commit 3d230a6

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uu/uuproc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ libc = { workspace = true }
2626
# macOS-specific dependencies can be added here
2727

2828
[target.'cfg(target_os = "windows")'.dependencies]
29-
# Windows-specific dependencies can be added here
29+
winapi = { version = "0.3", features = ["tlhelp32", "minwindef"] }
3030

3131
[lib]
3232
path = "src/lib.rs"

tests/by-util/test_uuproc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ fn test_walk_process_handles_process_with_no_cmdline() {
461461
// Some processes may have empty command lines (kernel threads)
462462
let processes: Vec<_> = walk_process().collect();
463463

464-
let _empty_cmdline: Vec<_> = processes.iter().filter(|p| p.cmdline.is_empty()).collect();
464+
let empty_cmdline: Vec<_> = processes.iter().filter(|p| p.cmdline.is_empty()).collect();
465465

466466
// On Linux, kernel threads have empty command lines
467467
#[cfg(target_os = "linux")]
@@ -637,7 +637,7 @@ fn test_windows_current_process_detection() {
637637
#[cfg(unix)]
638638
fn test_unix_process_hierarchy() {
639639
// Verify process hierarchy on Unix systems
640-
let _processes: Vec<_> = walk_process().collect();
640+
let processes: Vec<_> = walk_process().collect();
641641

642642
// Should have init process (PID 1) on Unix
643643
#[cfg(target_os = "linux")]

0 commit comments

Comments
 (0)