Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Issue

Fixes #382

Windows build was showing an unused variable warning because the metadata variable was only used inside a #[cfg(unix)] block.

Fix

Moved the #[cfg(unix)] attribute to apply to the entire if statement, preventing the variable binding from being created on Windows.

Before

if let Ok(metadata) = fs::metadata(parent_dir) {
    #[cfg(unix)]
    {
        // use metadata
    }
}

After

#[cfg(unix)]
if let Ok(metadata) = fs::metadata(parent_dir) {
    // use metadata
}

Testing

This is a test PR for our automated release workflow. Once merged:

  1. release-plz should create a version bump PR
  2. Merging that PR should publish to crates.io and create a tag
  3. Tag should trigger cargo-dist and Docker builds

Let's verify the end-to-end automation works!

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
@joshrotenberg joshrotenberg merged commit ac9f277 into main Oct 7, 2025
16 checks passed
@joshrotenberg joshrotenberg deleted the fix/unused-variable-382 branch October 7, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: unused variable warning in support_package.rs

2 participants