Skip to content

Commit 81b4a56

Browse files
committed
Fix clippy::useless_conversion warning
``` warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> futures/tests/stream_select_all.rs:83:38 | 83 | ...ec![stream::iter(vec![1].into_iter()), stream::iter(vec![2].i... | ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1]` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /Users/taiki/projects/sources/rust-lang/futures-rs/futures-util/src/stream/iter.rs:31:8 | 31 | I: IntoIterator, | ^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> futures/tests/stream_select_all.rs:83:73 | 83 | ...)), stream::iter(vec![2].into_iter())]); | ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![2]` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /Users/taiki/projects/sources/rust-lang/futures-rs/futures-util/src/stream/iter.rs:31:8 | 31 | I: IntoIterator, | ^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> futures/tests/stream_select_all.rs:91:29 | 91 | tasks.push(stream::iter(vec![3].into_iter())); | ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![3]` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /Users/taiki/projects/sources/rust-lang/futures-rs/futures-util/src/stream/iter.rs:31:8 | 31 | I: IntoIterator, | ^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> futures/tests/async_await_macros.rs:325:41 | 325 | ...ct!(stream::iter(vec![1].into_iter()), stream::iter(vec![1].... | ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1]` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /Users/taiki/projects/sources/rust-lang/futures-rs/futures-util/src/stream/iter.rs:31:8 | 31 | I: IntoIterator, | ^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> futures/tests/async_await_macros.rs:325:76 | 325 | ...)), stream::iter(vec![1].into_iter())); | ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1]` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /Users/taiki/projects/sources/rust-lang/futures-rs/futures-util/src/stream/iter.rs:31:8 | 31 | I: IntoIterator, | ^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion ```
1 parent 67b417d commit 81b4a56

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Diff for: futures/tests/async_await_macros.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ fn stream_select() {
321321
assert_eq!(endless_ones.next().await, Some(1));
322322
assert_eq!(endless_ones.next().await, Some(1));
323323

324-
let mut finite_list =
325-
stream_select!(stream::iter(vec![1].into_iter()), stream::iter(vec![1].into_iter()));
324+
let mut finite_list = stream_select!(stream::iter(vec![1]), stream::iter(vec![1]));
326325
assert_eq!(finite_list.next().await, Some(1));
327326
assert_eq!(finite_list.next().await, Some(1));
328327
assert_eq!(finite_list.next().await, None);

Diff for: futures/tests/stream_select_all.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,15 @@ fn works_1() {
7979

8080
#[test]
8181
fn clear() {
82-
let mut tasks =
83-
select_all(vec![stream::iter(vec![1].into_iter()), stream::iter(vec![2].into_iter())]);
82+
let mut tasks = select_all(vec![stream::iter(vec![1]), stream::iter(vec![2])]);
8483

8584
assert_eq!(block_on(tasks.next()), Some(1));
8685
assert!(!tasks.is_empty());
8786

8887
tasks.clear();
8988
assert!(tasks.is_empty());
9089

91-
tasks.push(stream::iter(vec![3].into_iter()));
90+
tasks.push(stream::iter(vec![3]));
9291
assert!(!tasks.is_empty());
9392

9493
tasks.clear();

0 commit comments

Comments
 (0)