mirror of
https://github.com/bertptrs/tracing-mutex.git
synced 2025-12-25 12:40:31 +01:00
Fix clippy issues
This commit is contained in:
5
Cargo.lock
generated
5
Cargo.lock
generated
@@ -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",
|
||||
|
||||
@@ -29,6 +29,8 @@ use crate::LazyMutexId;
|
||||
/// println!("{}", *LOCK);
|
||||
/// ```
|
||||
pub struct LazyLock<T, F = fn() -> T> {
|
||||
// MSRV violation is fine, this is gated behind a cfg! check
|
||||
#[allow(clippy::incompatible_msrv)]
|
||||
inner: std::sync::LazyLock<T, F>,
|
||||
id: LazyMutexId,
|
||||
}
|
||||
@@ -38,6 +40,8 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
|
||||
pub const fn new(f: F) -> LazyLock<T, F> {
|
||||
Self {
|
||||
id: LazyMutexId::new(),
|
||||
// MSRV violation is fine, this is gated behind a cfg! check
|
||||
#[allow(clippy::incompatible_msrv)]
|
||||
inner: std::sync::LazyLock::new(f),
|
||||
}
|
||||
}
|
||||
@@ -46,7 +50,7 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
|
||||
///
|
||||
/// This is equivalent to dereferencing, but is more explicit.
|
||||
pub fn force(this: &LazyLock<T, F>) -> &T {
|
||||
&*this
|
||||
this
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user