You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: futures-async-macro/README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Add this to your `Cargo.toml`:
7
7
8
8
```toml
9
9
[dependencies]
10
-
futures-preview = { version = "0.3.0-alpha.16", features = ["async-stream", "nightly"] }
10
+
futures-preview = { version = "=0.3.0-alpha.16", features = ["async-stream", "nightly"] }
11
11
```
12
12
13
13
### \#\[for_await\]
@@ -41,15 +41,15 @@ use futures::prelude::*;
41
41
usefutures::async_stream;
42
42
43
43
// Returns a stream of i32
44
-
#[async_stream]
45
-
fnfoo(stream:implStream<Item=String>) ->i32{
44
+
#[async_stream(item =i32)]
45
+
fnfoo(stream:implStream<Item=String>) {
46
46
#[for_await]
47
47
forxinstream {
48
48
yieldx.parse().unwrap();
49
49
}
50
50
}
51
51
```
52
52
53
-
`#[async_stream]` have an item type specified via `-> some::Path` and the values output from the stream must be yielded via the `yield` expression.
53
+
`#[async_stream]`must have an item type specified via `item = some::Path` and the values output from the stream must be yielded via the `yield` expression.
0 commit comments