Skip to content

Commit

Permalink
Work around dead_code warning in flock implementation
Browse files Browse the repository at this point in the history
    warning: field `0` is never read
      --> src/flock.rs:22:12
       |
    22 |     Locked(MutexGuard<'static, ()>),
       |     ------ ^^^^^^^^^^^^^^^^^^^^^^^
       |     |
       |     field in this variant
       |
       = note: `#[warn(dead_code)]` on by default
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
       |
    22 |     Locked(()),
       |            ~~
  • Loading branch information
dtolnay committed Jan 6, 2024
1 parent 0081291 commit b720ee6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Lock {
// integration test crate.
enum Guard {
NotLocked,
Locked(MutexGuard<'static, ()>),
Locked(#[allow(dead_code)] MutexGuard<'static, ()>),
}

// Best-effort filesystem lock to coordinate different #[test] functions across
Expand Down

0 comments on commit b720ee6

Please sign in to comment.