Skip to content

Commit 7f9ef66

Browse files
authored
Fix clippy::needless_lifetimes warning (#113)
``` warning: the following explicit lifetimes could be elided: 'a --> async-stream/src/yielder.rs:90:6 | 90 | impl<'a, T> Drop for Enter<'a, T> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 90 - impl<'a, T> Drop for Enter<'a, T> { 90 + impl<T> Drop for Enter<'_, T> { | warning: the following explicit lifetimes could be elided: 'a --> async-stream/tests/stream.rs:164:19 | 164 | fn stream<'a>(&'a self) -> impl Stream<Item = &str> + 'a { | ^^ ^^ ^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 164 - fn stream<'a>(&'a self) -> impl Stream<Item = &str> + 'a { 164 + fn stream(&self) -> impl Stream<Item = &str> + '_ { | ```
1 parent b0b2f22 commit 7f9ef66

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

async-stream/src/yielder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<T> Receiver<T> {
8787

8888
// ===== impl Enter =====
8989

90-
impl<'a, T> Drop for Enter<'a, T> {
90+
impl<T> Drop for Enter<'_, T> {
9191
fn drop(&mut self) {
9292
STORE.with(|cell| cell.set(self.prev));
9393
}

async-stream/tests/stream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ async fn borrow_self() {
161161
struct Data(String);
162162

163163
impl Data {
164-
fn stream<'a>(&'a self) -> impl Stream<Item = &str> + 'a {
164+
fn stream(&self) -> impl Stream<Item = &str> + '_ {
165165
stream! {
166166
yield &self.0[..];
167167
}

0 commit comments

Comments
 (0)