Skip to content

Commit

Permalink
Merge branch 'main' into fix-docs-link
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw authored Dec 26, 2024
2 parents 5b2fc57 + 43bd2f7 commit 6f6d086
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = ["memory-management", "data-structures", "concurrency"]
description = """
A lock-free concurrent slab.
"""
ignore = [
exclude = [
"flake.nix",
"flake.lock",
".envrc",
Expand Down Expand Up @@ -51,3 +51,6 @@ loom = { version = "0.5", features = ["checkpoint"] }
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(loom)', 'cfg(slab_print)'] }
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ unsafe impl<T: Sync, C: cfg::Config> Sync for Slab<T, C> {}

// === impl Entry ===

impl<'a, T, C: cfg::Config> Entry<'a, T, C> {
impl<T, C: cfg::Config> Entry<'_, T, C> {
/// Returns the key used to access the guard.
pub fn key(&self) -> usize {
self.key
Expand All @@ -800,15 +800,15 @@ impl<'a, T, C: cfg::Config> Entry<'a, T, C> {
}
}

impl<'a, T, C: cfg::Config> std::ops::Deref for Entry<'a, T, C> {
impl<T, C: cfg::Config> std::ops::Deref for Entry<'_, T, C> {
type Target = T;

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

impl<'a, T, C: cfg::Config> Drop for Entry<'a, T, C> {
impl<T, C: cfg::Config> Drop for Entry<'_, T, C> {
fn drop(&mut self) {
let should_remove = unsafe {
// Safety: calling `slot::Guard::release` is unsafe, since the
Expand All @@ -825,7 +825,7 @@ impl<'a, T, C: cfg::Config> Drop for Entry<'a, T, C> {
}
}

impl<'a, T, C> fmt::Debug for Entry<'a, T, C>
impl<T, C> fmt::Debug for Entry<'_, T, C>
where
T: fmt::Debug,
C: cfg::Config,
Expand All @@ -835,7 +835,7 @@ where
}
}

impl<'a, T, C> PartialEq<T> for Entry<'a, T, C>
impl<T, C> PartialEq<T> for Entry<'_, T, C>
where
T: PartialEq<T>,
C: cfg::Config,
Expand All @@ -854,7 +854,7 @@ where

// === impl VacantEntry ===

impl<'a, T, C: cfg::Config> VacantEntry<'a, T, C> {
impl<T, C: cfg::Config> VacantEntry<'_, T, C> {
/// Insert a value in the entry.
///
/// To get the integer index at which this value will be inserted, use
Expand Down
20 changes: 10 additions & 10 deletions src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ where

// === impl Ref ===

impl<'a, T, C> Ref<'a, T, C>
impl<T, C> Ref<'_, T, C>
where
T: Clear + Default,
C: cfg::Config,
Expand All @@ -893,7 +893,7 @@ where
}
}

impl<'a, T, C> std::ops::Deref for Ref<'a, T, C>
impl<T, C> std::ops::Deref for Ref<'_, T, C>
where
T: Clear + Default,
C: cfg::Config,
Expand All @@ -905,7 +905,7 @@ where
}
}

impl<'a, T, C> Drop for Ref<'a, T, C>
impl<T, C> Drop for Ref<'_, T, C>
where
T: Clear + Default,
C: cfg::Config,
Expand All @@ -927,7 +927,7 @@ where
}
}

impl<'a, T, C> fmt::Debug for Ref<'a, T, C>
impl<T, C> fmt::Debug for Ref<'_, T, C>
where
T: fmt::Debug + Clear + Default,
C: cfg::Config,
Expand All @@ -937,7 +937,7 @@ where
}
}

impl<'a, T, C> PartialEq<T> for Ref<'a, T, C>
impl<T, C> PartialEq<T> for Ref<'_, T, C>
where
T: PartialEq<T> + Clear + Default,
C: cfg::Config,
Expand Down Expand Up @@ -1014,7 +1014,7 @@ where
}
}

impl<'a, T, C: cfg::Config> std::ops::Deref for RefMut<'a, T, C>
impl<T, C: cfg::Config> std::ops::Deref for RefMut<'_, T, C>
where
T: Clear + Default,
C: cfg::Config,
Expand All @@ -1026,7 +1026,7 @@ where
}
}

impl<'a, T, C> std::ops::DerefMut for RefMut<'a, T, C>
impl<T, C> std::ops::DerefMut for RefMut<'_, T, C>
where
T: Clear + Default,
C: cfg::Config,
Expand All @@ -1040,7 +1040,7 @@ where
}
}

impl<'a, T, C> Drop for RefMut<'a, T, C>
impl<T, C> Drop for RefMut<'_, T, C>
where
T: Clear + Default,
C: cfg::Config,
Expand All @@ -1058,7 +1058,7 @@ where
}
}

impl<'a, T, C> fmt::Debug for RefMut<'a, T, C>
impl<T, C> fmt::Debug for RefMut<'_, T, C>
where
T: fmt::Debug + Clear + Default,
C: cfg::Config,
Expand All @@ -1068,7 +1068,7 @@ where
}
}

impl<'a, T, C> PartialEq<T> for RefMut<'a, T, C>
impl<T, C> PartialEq<T> for RefMut<'_, T, C>
where
T: PartialEq<T> + Clear + Default,
C: cfg::Config,
Expand Down

0 comments on commit 6f6d086

Please sign in to comment.