Skip to content

Commit a3971f8

Browse files
committed
fix: remove unused variable warning on Windows builds
Move cfg(unix) attribute to the if statement level instead of inside the block. This prevents the metadata binding from being created on Windows where it's unused. Closes #382
1 parent a7094d7 commit a3971f8

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

crates/redisctl/src/commands/enterprise/support_package.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -396,16 +396,13 @@ fn perform_preflight_checks(output_path: &Path) -> AnyhowResult<()> {
396396
}
397397

398398
// Check available disk space (warn if less than 1GB)
399+
// Only perform check on Unix systems where we can read block count
400+
#[cfg(unix)]
399401
if let Ok(metadata) = fs::metadata(parent_dir) {
400-
// This is platform-specific and would need proper implementation
401-
// For now, just a placeholder check
402-
#[cfg(unix)]
403-
{
404-
use std::os::unix::fs::MetadataExt;
405-
// Basic check - would need proper disk space checking
406-
if metadata.blocks() < 1000000 {
407-
eprintln!("Warning: Low disk space detected");
408-
}
402+
use std::os::unix::fs::MetadataExt;
403+
// Basic check - would need proper disk space checking
404+
if metadata.blocks() < 1000000 {
405+
eprintln!("Warning: Low disk space detected");
409406
}
410407
}
411408

0 commit comments

Comments
 (0)