Skip to content

Commit 87e8613

Browse files
committed
Remove needless lifetimes
1 parent 8301de1 commit 87e8613

File tree

15 files changed

+21
-21
lines changed

15 files changed

+21
-21
lines changed

src/liballoc/collections/btree/map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,7 @@ impl<K, V> BTreeMap<K, V> {
20042004
/// assert_eq!(keys, [1, 2]);
20052005
/// ```
20062006
#[stable(feature = "rust1", since = "1.0.0")]
2007-
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
2007+
pub fn keys(&self) -> Keys<'_, K, V> {
20082008
Keys { inner: self.iter() }
20092009
}
20102010

@@ -2025,7 +2025,7 @@ impl<K, V> BTreeMap<K, V> {
20252025
/// assert_eq!(values, ["hello", "goodbye"]);
20262026
/// ```
20272027
#[stable(feature = "rust1", since = "1.0.0")]
2028-
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
2028+
pub fn values(&self) -> Values<'_, K, V> {
20292029
Values { inner: self.iter() }
20302030
}
20312031

@@ -2529,8 +2529,8 @@ enum UnderflowResult<'a, K, V> {
25292529
Stole(NodeRef<marker::Mut<'a>, K, V, marker::Internal>),
25302530
}
25312531

2532-
fn handle_underfull_node<'a, K, V>(node: NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>)
2533-
-> UnderflowResult<'a, K, V> {
2532+
fn handle_underfull_node<K, V>(node: NodeRef<marker::Mut<'_>, K, V, marker::LeafOrInternal>)
2533+
-> UnderflowResult<'_, K, V> {
25342534
let parent = if let Ok(parent) = node.ascend() {
25352535
parent
25362536
} else {

src/liballoc/collections/btree/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
394394
}
395395

396396
/// Temporarily takes out another, immutable reference to the same node.
397-
fn reborrow<'a>(&'a self) -> NodeRef<marker::Immut<'a>, K, V, Type> {
397+
fn reborrow(&self) -> NodeRef<marker::Immut<'_>, K, V, Type> {
398398
NodeRef {
399399
height: self.height,
400400
node: self.node,

src/liballoc/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ impl String {
552552
/// assert_eq!("Hello �World", output);
553553
/// ```
554554
#[stable(feature = "rust1", since = "1.0.0")]
555-
pub fn from_utf8_lossy<'a>(v: &'a [u8]) -> Cow<'a, str> {
555+
pub fn from_utf8_lossy(v: &[u8]) -> Cow<'_, str> {
556556
let mut iter = lossy::Utf8Lossy::from_bytes(v).chunks();
557557

558558
let (first_valid, first_broken) = if let Some(chunk) = iter.next() {

src/libcore/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ macro_rules! impls{
498498
/// # end: *const T,
499499
/// # phantom: PhantomData<&'a T>,
500500
/// # }
501-
/// fn borrow_vec<'a, T>(vec: &'a Vec<T>) -> Slice<'a, T> {
501+
/// fn borrow_vec<T>(vec: &Vec<T>) -> Slice<T> {
502502
/// let ptr = vec.as_ptr();
503503
/// Slice {
504504
/// start: ptr,

src/libcore/ops/index.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub trait Index<Idx: ?Sized> {
105105
/// impl Index<Side> for Balance {
106106
/// type Output = Weight;
107107
///
108-
/// fn index<'a>(&'a self, index: Side) -> &'a Self::Output {
108+
/// fn index(&self, index: Side) -> &Self::Output {
109109
/// println!("Accessing {:?}-side of balance immutably", index);
110110
/// match index {
111111
/// Side::Left => &self.left,
@@ -115,7 +115,7 @@ pub trait Index<Idx: ?Sized> {
115115
/// }
116116
///
117117
/// impl IndexMut<Side> for Balance {
118-
/// fn index_mut<'a>(&'a mut self, index: Side) -> &'a mut Self::Output {
118+
/// fn index_mut(&mut self, index: Side) -> &mut Self::Output {
119119
/// println!("Accessing {:?}-side of balance mutably", index);
120120
/// match index {
121121
/// Side::Left => &mut self.left,

src/libproc_macro/bridge/scoped_cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<T: LambdaL> ScopedCell<T> {
7474
}
7575

7676
/// Sets the value in `self` to `value` while running `f`.
77-
pub fn set<'a, R>(&self, value: <T as ApplyL<'a>>::Out, f: impl FnOnce() -> R) -> R {
77+
pub fn set<R>(&self, value: <T as ApplyL<'_>>::Out, f: impl FnOnce() -> R) -> R {
7878
self.replace(value, |_| f())
7979
}
8080
}

src/libstd/sync/mpsc/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn wait_timeout_receiver<'a, 'b, T>(lock: &'a Mutex<State<T>>,
140140
new_guard
141141
}
142142

143-
fn abort_selection<'a, T>(guard: &mut MutexGuard<'a , State<T>>) -> bool {
143+
fn abort_selection<T>(guard: &mut MutexGuard<'_, State<T>>) -> bool {
144144
match mem::replace(&mut guard.blocker, NoneBlocked) {
145145
NoneBlocked => true,
146146
BlockedSender(token) => {

src/libstd/sys/redox/ext/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ impl UnixListener {
673673
/// }
674674
/// ```
675675
#[stable(feature = "unix_socket_redox", since = "1.29.0")]
676-
pub fn incoming<'a>(&'a self) -> Incoming<'a> {
676+
pub fn incoming(&self) -> Incoming {
677677
Incoming { listener: self }
678678
}
679679
}

src/libstd/sys/unix/ext/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ impl UnixListener {
894894
/// }
895895
/// ```
896896
#[stable(feature = "unix_socket", since = "1.10.0")]
897-
pub fn incoming<'a>(&'a self) -> Incoming<'a> {
897+
pub fn incoming(&self) -> Incoming<'_> {
898898
Incoming { listener: self }
899899
}
900900
}

src/libstd/sys/windows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fn wide_char_to_multi_byte(code_page: u32,
195195
}
196196
}
197197

198-
pub fn truncate_utf16_at_nul<'a>(v: &'a [u16]) -> &'a [u16] {
198+
pub fn truncate_utf16_at_nul(v: &[u16]) -> &[u16] {
199199
match v.iter().position(|c| *c == 0) {
200200
// don't include the 0
201201
Some(i) => &v[..i],

0 commit comments

Comments
 (0)