From b720ee6e5cd44ab7d8ab140a020006e0db6270a4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 5 Jan 2024 18:41:25 -0800 Subject: [PATCH] Work around dead_code warning in flock implementation 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(()), | ~~ --- src/flock.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flock.rs b/src/flock.rs index ec02384..24e24be 100644 --- a/src/flock.rs +++ b/src/flock.rs @@ -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