Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
- run:
name: Run all tests under sanitizers
command: |
RUSTFLAGS="-Z sanitizer=address" cargo +nightly -Z build-std test --target x86_64-unknown-linux-gnu --all-features
RUSTFLAGS="-Z sanitizer=leak" cargo +nightly test -Z build-std --target x86_64-unknown-linux-gnu --all-features
RUSTFLAGS="-Z sanitizer=memory" cargo +nightly test -Z build-std --target x86_64-unknown-linux-gnu --all-features
RUSTFLAGS="-Z sanitizer=address" cargo +nightly -Z build-std test --all-features
RUSTFLAGS="-Z sanitizer=leak" cargo +nightly test -Z build-std --all-features
RUSTFLAGS="-Z sanitizer=memory" cargo +nightly test -Z build-std --all-features
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "hashlink"
version = "0.10.0"
authors = ["kyren <[email protected]>"]
edition = "2018"
description = "HashMap-like containers that hold their key-value pairs in a user controllable order"
repository = "https://github.com/kyren/hashlink"
Expand Down
16 changes: 8 additions & 8 deletions src/linked_hash_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<K, V, S> LinkedHashMap<K, V, S> {
}

#[inline]
pub fn iter(&self) -> Iter<K, V> {
pub fn iter(&self) -> Iter<'_, K, V> {
let (head, tail) = if let Some(values) = self.values {
unsafe {
let ValueLinks { next, prev } = values.as_ref().links.value;
Expand All @@ -137,7 +137,7 @@ impl<K, V, S> LinkedHashMap<K, V, S> {
}

#[inline]
pub fn iter_mut(&mut self) -> IterMut<K, V> {
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
let (head, tail) = if let Some(values) = self.values {
unsafe {
let ValueLinks { next, prev } = values.as_ref().links.value;
Expand Down Expand Up @@ -183,17 +183,17 @@ impl<K, V, S> LinkedHashMap<K, V, S> {
}

#[inline]
pub fn keys(&self) -> Keys<K, V> {
pub fn keys(&self) -> Keys<'_, K, V> {
Keys { inner: self.iter() }
}

#[inline]
pub fn values(&self) -> Values<K, V> {
pub fn values(&self) -> Values<'_, K, V> {
Values { inner: self.iter() }
}

#[inline]
pub fn values_mut(&mut self) -> ValuesMut<K, V> {
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> {
ValuesMut {
inner: self.iter_mut(),
}
Expand Down Expand Up @@ -506,7 +506,7 @@ where
}

// Returns the `CursorMut` over the _guard_ node.
fn cursor_mut(&mut self) -> CursorMut<K, V, S> {
fn cursor_mut(&mut self) -> CursorMut<'_, K, V, S> {
unsafe { ensure_guard_node(&mut self.values) };
CursorMut {
cur: self.values.as_ptr(),
Expand All @@ -522,7 +522,7 @@ where
/// Note: The `CursorMut` is pointing to the _guard_ node in an empty `LinkedHashMap` and
/// will always return `None` as its current element, regardless of any move in any
/// direction.
pub fn cursor_front_mut(&mut self) -> CursorMut<K, V, S> {
pub fn cursor_front_mut(&mut self) -> CursorMut<'_, K, V, S> {
let mut c = self.cursor_mut();
c.move_next();
c
Expand All @@ -533,7 +533,7 @@ where
/// Note: The `CursorMut` is pointing to the _guard_ node in an empty `LinkedHashMap` and
/// will always return `None` as its current element, regardless of any move in any
/// direction.
pub fn cursor_back_mut(&mut self) -> CursorMut<K, V, S> {
pub fn cursor_back_mut(&mut self) -> CursorMut<'_, K, V, S> {
let mut c = self.cursor_mut();
c.move_prev();
c
Expand Down
2 changes: 1 addition & 1 deletion src/linked_hash_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl<T, S> LinkedHashSet<T, S> {
}

#[inline]
pub fn drain(&mut self) -> Drain<T> {
pub fn drain(&mut self) -> Drain<'_, T> {
Drain {
iter: self.map.drain(),
}
Expand Down
6 changes: 3 additions & 3 deletions src/lru_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ impl<K, V, S> LruCache<K, V, S> {
}

#[inline]
pub fn iter(&self) -> Iter<K, V> {
pub fn iter(&self) -> Iter<'_, K, V> {
self.map.iter()
}

#[inline]
pub fn iter_mut(&mut self) -> IterMut<K, V> {
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
self.map.iter_mut()
}

#[inline]
pub fn drain(&mut self) -> Drain<K, V> {
pub fn drain(&mut self) -> Drain<'_, K, V> {
self.map.drain()
}

Expand Down