2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-19 20:13:51 +00:00

Merge pull request #449 from async-rs/strip-vecdeque

remove remaining instances of VecDeque stream
This commit is contained in:
Yoshua Wuyts 2019-11-04 17:46:19 +01:00 committed by GitHub
commit 282ae064fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -20,10 +20,10 @@ where
``` ```
# fn main() { async_std::task::block_on(async { # fn main() { async_std::task::block_on(async {
# #
use std::collections::VecDeque;
use async_std::prelude::*; use async_std::prelude::*;
use async_std::stream;
let v: VecDeque<_> = vec![1, 2, 4].into_iter().collect(); let v = stream::from_iter(vec![1, 2, 4]);
let prod: Option<i32> = v.map(|x| let prod: Option<i32> = v.map(|x|
if x < 0 { if x < 0 {
None None

View file

@ -2012,10 +2012,10 @@ extension_trait! {
# fn main() { async_std::task::block_on(async { # fn main() { async_std::task::block_on(async {
# #
async fn factorial(n: u32) -> u32 { async fn factorial(n: u32) -> u32 {
use std::collections::VecDeque;
use async_std::prelude::*; use async_std::prelude::*;
use async_std::stream;
let s: VecDeque<_> = (1..=n).collect(); let s = stream::from_iter(1..=n);
s.product().await s.product().await
} }