Skip to content

Commit

Permalink
ignore clippy MSRV lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Nov 2, 2024
1 parent 7e3d648 commit a45974a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ impl<T> OnceLockExt<T> for std::sync::OnceLock<T> {
where
F: FnOnce() -> T,
{
// this trait is guarded by a rustc version config
// so clippy's MSRV check is wrong
#[allow(clippy::incompatible_msrv)]
// Use self.get() first to create a fast path when initialized
self.get()
.unwrap_or_else(|| init_once_lock_py_attached(self, py, f))
Expand Down Expand Up @@ -599,6 +602,9 @@ where
// SAFETY: we are currently attached to a Python thread
let ts_guard = Guard(Some(unsafe { ffi::PyEval_SaveThread() }));

// this trait is guarded by a rustc version config
// so clippy's MSRV check is wrong
#[allow(clippy::incompatible_msrv)]
// By having detached here, we guarantee that `.get_or_init` cannot deadlock with
// the Python interpreter
let value = lock.get_or_init(move || {
Expand Down

0 comments on commit a45974a

Please sign in to comment.