2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-16 10:49:55 +00:00

Merge pull request #73 from U007D/patch-1

Clarify async fn return type
This commit is contained in:
Florian Gilcher 2019-08-18 11:25:21 +02:00 committed by GitHub
commit 5fbeb52b69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,7 +102,7 @@ While the `Future` trait has existed in Rust for a while, it was inconvenient to
Amazingly little difference, right? All we did is label the function `async` and insert 2 special commands: `.await`.
This function sets up a deferred computation. When this function is called, it will produce a `Future<Output=Result<String, io::Error>>` instead of immediately returning the `Result`. (Or, more precisely, generate a type for you that implements `Future<Output=Result<String, io::Error>>`.)
This function sets up a deferred computation. When this function is called, it will produce a `Future<Output=Result<String, io::Error>>` instead of immediately returning a `Result<String, io::Error>`. (Or, more precisely, generate a type for you that implements `Future<Output=Result<String, io::Error>>`.)
## What does `.await` do?