From 5d947912f1a6c2dd320e06ace5c2cfd3ed098cf0 Mon Sep 17 00:00:00 2001 From: marc0246 <40955683+marc0246@users.noreply.github.com> Date: Sun, 16 Jun 2024 17:00:41 +0200 Subject: [PATCH] Fix elided lifetimes --- src/epoch.rs | 2 +- src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/epoch.rs b/src/epoch.rs index 2dc34d9..4348826 100644 --- a/src/epoch.rs +++ b/src/epoch.rs @@ -368,7 +368,7 @@ impl Drop for Guard<'_> { impl<'a> From<&'a Guard<'a>> for Cow<'a, Guard<'a>> { #[inline] - fn from(guard: &'a Guard) -> Self { + fn from(guard: &'a Guard<'a>) -> Self { Cow::Borrowed(guard) } } diff --git a/src/lib.rs b/src/lib.rs index 9e57700..128a16f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ #![allow(unused_unsafe, clippy::inline_always)] +#![warn(rust_2018_idioms)] #![forbid(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)] #![cfg_attr(not(feature = "std"), no_std)] @@ -353,7 +354,7 @@ impl> SlotMap { } } - pub fn try_collect(&self, guard: &epoch::Guard) { + pub fn try_collect(&self, guard: &epoch::Guard<'_>) { let epoch = guard.epoch(); let queued_list = &self.free_list_queue[((epoch >> 1) & 1) as usize]; let mut queued_state = queued_list.load(Acquire);