Skip to content

Commit c6bd81b

Browse files
committed
Resolve clippy::needless_lifetimes
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) --> src/range_map.rs:66:5 | 66 | pub fn iter<'a>(&'a self, offset: Size, len: Size) -> impl Iterator<Item = (Size, &'a T)> + 'a { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::needless-lifetimes` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) --> src/range_map.rs:86:5 | 86 | pub fn iter_mut_all<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T> + 'a { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) --> src/range_map.rs:122:5 | 122 | / pub fn iter_mut<'a>( 123 | | &'a mut self, 124 | | offset: Size, 125 | | len: Size, 126 | | ) -> impl Iterator<Item = (Size, &'a mut T)> + 'a | |_____________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) --> src/shims/intrinsics.rs:1391:1 | 1391 | fn simd_element_to_bool<'tcx>(elem: ImmTy<'tcx, Tag>) -> InterpResult<'tcx, bool> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
1 parent 2ca7f3b commit c6bd81b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/range_map.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<T> RangeMap<T> {
6363
/// through interior mutability.
6464
///
6565
/// The iterator also provides the offset of the given element.
66-
pub fn iter<'a>(&'a self, offset: Size, len: Size) -> impl Iterator<Item = (Size, &'a T)> + 'a {
66+
pub fn iter(&self, offset: Size, len: Size) -> impl Iterator<Item = (Size, &T)> {
6767
let offset = offset.bytes();
6868
let len = len.bytes();
6969
// Compute a slice starting with the elements we care about.
@@ -83,7 +83,7 @@ impl<T> RangeMap<T> {
8383
.map(|elem| (Size::from_bytes(elem.range.start), &elem.data))
8484
}
8585

86-
pub fn iter_mut_all<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T> + 'a {
86+
pub fn iter_mut_all(&mut self) -> impl Iterator<Item = &mut T> {
8787
self.v.iter_mut().map(|elem| &mut elem.data)
8888
}
8989

@@ -119,11 +119,7 @@ impl<T> RangeMap<T> {
119119
/// Moreover, this will opportunistically merge neighbouring equal blocks.
120120
///
121121
/// The iterator also provides the offset of the given element.
122-
pub fn iter_mut<'a>(
123-
&'a mut self,
124-
offset: Size,
125-
len: Size,
126-
) -> impl Iterator<Item = (Size, &'a mut T)> + 'a
122+
pub fn iter_mut(&mut self, offset: Size, len: Size) -> impl Iterator<Item = (Size, &mut T)>
127123
where
128124
T: Clone + PartialEq,
129125
{

0 commit comments

Comments
 (0)