From 342a01435b1c31f9a4382eafb7552d94607a033b Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Sat, 18 Jan 2025 12:02:23 +0100 Subject: [PATCH] Fix clippy issues --- Cargo.lock | 5 +++-- src/stdsync/tracing/lazy_lock.rs | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 84c3481..c91aa51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,9 +25,9 @@ checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" @@ -619,6 +619,7 @@ dependencies = [ name = "tracing-mutex" version = "0.3.0" dependencies = [ + "autocfg", "criterion", "lock_api", "parking_lot", diff --git a/src/stdsync/tracing/lazy_lock.rs b/src/stdsync/tracing/lazy_lock.rs index 16953d1..ef6c573 100644 --- a/src/stdsync/tracing/lazy_lock.rs +++ b/src/stdsync/tracing/lazy_lock.rs @@ -29,6 +29,8 @@ use crate::LazyMutexId; /// println!("{}", *LOCK); /// ``` pub struct LazyLock T> { + // MSRV violation is fine, this is gated behind a cfg! check + #[allow(clippy::incompatible_msrv)] inner: std::sync::LazyLock, id: LazyMutexId, } @@ -46,7 +48,7 @@ impl T> LazyLock { /// /// This is equivalent to dereferencing, but is more explicit. pub fn force(this: &LazyLock) -> &T { - &*this + this } }