Skip to content

Commit

Permalink
Fix clippy::needless_lifetimes warning
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Oct 13, 2020
1 parent 74b2ff0 commit 5df6d68
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion futures-util/src/stream/futures_unordered/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<Fut> ArcWake for Task<Fut> {

impl<Fut> Task<Fut> {
/// Returns a waker reference for this task without cloning the Arc.
pub(super) fn waker_ref<'a>(this: &'a Arc<Task<Fut>>) -> WakerRef<'a> {
pub(super) fn waker_ref(this: &Arc<Task<Fut>>) -> WakerRef<'_> {
waker_ref(this)
}

Expand Down
2 changes: 1 addition & 1 deletion futures/tests/join_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn join_all_iter_lifetime() {
use std::future::Future;
// In futures-rs version 0.1, this function would fail to typecheck due to an overly
// conservative type parameterization of `JoinAll`.
fn sizes<'a>(bufs: Vec<&'a [u8]>) -> Box<dyn Future<Output = Vec<usize>> + Unpin> {
fn sizes(bufs: Vec<&[u8]>) -> Box<dyn Future<Output = Vec<usize>> + Unpin> {
let iter = bufs.into_iter().map(|b| ready::<usize>(b.len()));
Box::new(join_all(iter))
}
Expand Down
2 changes: 1 addition & 1 deletion futures/tests/try_join_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn try_join_all_iter_lifetime() {

// In futures-rs version 0.1, this function would fail to typecheck due to an overly
// conservative type parameterization of `TryJoinAll`.
fn sizes<'a>(bufs: Vec<&'a [u8]>) -> Box<dyn Future<Output = Result<Vec<usize>, ()>> + Unpin> {
fn sizes(bufs: Vec<&[u8]>) -> Box<dyn Future<Output = Result<Vec<usize>, ()>> + Unpin> {
let iter = bufs.into_iter().map(|b| ok::<usize, ()>(b.len()));
Box::new(try_join_all(iter))
}
Expand Down

0 comments on commit 5df6d68

Please sign in to comment.