@@ -71,6 +71,7 @@ new syntax:
7171[ hyper#1805 ] : https://github.com/hyperium/hyper/issues/1805
7272[ async-std ] : https://async.rs/
7373[ wf ] : https://www.arewewebyet.org/topics/frameworks/
74+ [ JavaScript promises ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises
7475
7576### Async-await: a quick primer
7677
@@ -82,9 +83,8 @@ can "pause", return control to the runtime, and then pick up from
8283where they left off. Typically those pauses are to wait for I/O, but
8384there can be any number of uses.
8485
85- You may be familiar with the async-await from other languages, such as
86- JavaScript or C#. Rust's version of the feature is similar, but with a
87- few key differences.
86+ You may be familiar with the async-await from JavaScript or C#. Rust's
87+ version of the feature is similar, but with a few key differences.
8888
8989To use async-await, you start by writing ` async fn ` instead of ` fn ` :
9090
@@ -118,12 +118,12 @@ errors. It also has the advantage of making method chaining painless.
118118
119119### Zero-cost futures
120120
121- The other difference between Rust futures and futures in other
122- languages is that they are based on a "poll" model, which makes them
123- ** zero cost** . In other languages, invoking an async function
124- immediately creates a future and schedules it for execution: awaiting
125- the future isn't necessary for it to execute. But this implies some
126- overhead for each future that is created.
121+ The other difference between Rust futures and futures in JS and C# is
122+ that they are based on a "poll" model, which makes them ** zero
123+ cost** . In other languages, invoking an async function immediately
124+ creates a future and schedules it for execution: awaiting the future
125+ isn't necessary for it to execute. But this implies some overhead for
126+ each future that is created.
127127
128128In contrast, in Rust, calling an async function does not do any
129129scheduling in and of itself, which means that we can compose a complex
0 commit comments