Skip to content

Commit

Permalink
style: make use of lifetime elision, fixing new clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
austinhartzheim committed Dec 25, 2024
1 parent 91a9c79 commit d476240
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<'a> ReadGuard<'a> {
}
}

impl<'a> Drop for ReadGuard<'a> {
impl Drop for ReadGuard<'_> {
/// Unlocks stored `version` when `ReadGuard` goes out of scope
fn drop(&mut self) {
self.state.runlock(self.version);
Expand Down Expand Up @@ -66,7 +66,7 @@ impl<'a, T: Archive> ReadResult<'a, T> {
}
}

impl<'a, T: Archive> Deref for ReadResult<'a, T> {
impl<T: Archive> Deref for ReadResult<'_, T> {
type Target = Archived<T>;

/// Dereferences stored `entity` for easier access
Expand Down
12 changes: 6 additions & 6 deletions src/locks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ impl<'a> WriteLockStrategySealed<'a> for LockDisabled {
}
}

impl<'a> WriteLockStrategy<'a> for LockDisabled {}
impl WriteLockStrategy<'_> for LockDisabled {}

pub struct DisabledGuard<'a>(&'a mut MmapMut);

impl<'a> Deref for DisabledGuard<'a> {
impl Deref for DisabledGuard<'_> {
type Target = MmapMut;

fn deref(&self) -> &Self::Target {
&*self.0
}
}

impl<'a> DerefMut for DisabledGuard<'a> {
impl DerefMut for DisabledGuard<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut *self.0
}
Expand Down Expand Up @@ -145,14 +145,14 @@ impl<'a> WriteLockStrategySealed<'a> for SingleWriter {
}

#[cfg(unix)]
impl<'a> WriteLockStrategy<'a> for SingleWriter {}
impl WriteLockStrategy<'_> for SingleWriter {}

/// A simple guard which does not release the lock upon being dropped.
#[cfg(unix)]
pub struct SingleWriterGuard<'a>(&'a mut MmapMut);

#[cfg(unix)]
impl<'a> Deref for SingleWriterGuard<'a> {
impl Deref for SingleWriterGuard<'_> {
type Target = MmapMut;

fn deref(&self) -> &Self::Target {
Expand All @@ -161,7 +161,7 @@ impl<'a> Deref for SingleWriterGuard<'a> {
}

#[cfg(unix)]
impl<'a> DerefMut for SingleWriterGuard<'a> {
impl DerefMut for SingleWriterGuard<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut *self.0
}
Expand Down
2 changes: 1 addition & 1 deletion src/synchronizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ where
pub unsafe fn read<T>(
&'a mut self,
check_bytes: bool,
) -> Result<ReadResult<T>, SynchronizerError>
) -> Result<ReadResult<'a, T>, SynchronizerError>
where
T: Archive,
T::Archived: for<'b> CheckBytes<DefaultValidator<'b>>,
Expand Down

0 comments on commit d476240

Please sign in to comment.