diff --git a/.circleci/config.yml b/.circleci/config.yml index 00e8e9f..208cdb4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index ea872f4..985915f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "hashlink" version = "0.10.0" -authors = ["kyren "] edition = "2018" description = "HashMap-like containers that hold their key-value pairs in a user controllable order" repository = "https://github.com/kyren/hashlink" diff --git a/src/linked_hash_map.rs b/src/linked_hash_map.rs index 6ba6478..d2f021d 100644 --- a/src/linked_hash_map.rs +++ b/src/linked_hash_map.rs @@ -118,7 +118,7 @@ impl LinkedHashMap { } #[inline] - pub fn iter(&self) -> Iter { + 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; @@ -137,7 +137,7 @@ impl LinkedHashMap { } #[inline] - pub fn iter_mut(&mut self) -> IterMut { + 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; @@ -183,17 +183,17 @@ impl LinkedHashMap { } #[inline] - pub fn keys(&self) -> Keys { + pub fn keys(&self) -> Keys<'_, K, V> { Keys { inner: self.iter() } } #[inline] - pub fn values(&self) -> Values { + pub fn values(&self) -> Values<'_, K, V> { Values { inner: self.iter() } } #[inline] - pub fn values_mut(&mut self) -> ValuesMut { + pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> { ValuesMut { inner: self.iter_mut(), } @@ -506,7 +506,7 @@ where } // Returns the `CursorMut` over the _guard_ node. - fn cursor_mut(&mut self) -> CursorMut { + fn cursor_mut(&mut self) -> CursorMut<'_, K, V, S> { unsafe { ensure_guard_node(&mut self.values) }; CursorMut { cur: self.values.as_ptr(), @@ -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 { + pub fn cursor_front_mut(&mut self) -> CursorMut<'_, K, V, S> { let mut c = self.cursor_mut(); c.move_next(); c @@ -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 { + pub fn cursor_back_mut(&mut self) -> CursorMut<'_, K, V, S> { let mut c = self.cursor_mut(); c.move_prev(); c diff --git a/src/linked_hash_set.rs b/src/linked_hash_set.rs index ecaf9ea..bc2122f 100644 --- a/src/linked_hash_set.rs +++ b/src/linked_hash_set.rs @@ -53,7 +53,7 @@ impl LinkedHashSet { } #[inline] - pub fn drain(&mut self) -> Drain { + pub fn drain(&mut self) -> Drain<'_, T> { Drain { iter: self.map.drain(), } diff --git a/src/lru_cache.rs b/src/lru_cache.rs index 33cabbb..d38a382 100644 --- a/src/lru_cache.rs +++ b/src/lru_cache.rs @@ -65,17 +65,17 @@ impl LruCache { } #[inline] - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, K, V> { self.map.iter() } #[inline] - pub fn iter_mut(&mut self) -> IterMut { + pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { self.map.iter_mut() } #[inline] - pub fn drain(&mut self) -> Drain { + pub fn drain(&mut self) -> Drain<'_, K, V> { self.map.drain() }