mirror of https://github.com/rust-lang/async-book
Remove async_await feature
This commit is contained in:
parent
a9d80c6402
commit
2bdc0a1d77
|
@ -2,7 +2,7 @@ sudo: false
|
|||
dist: trusty
|
||||
language: rust
|
||||
cache: cargo
|
||||
rust: nightly-2019-05-09 # minimum required version for async/await
|
||||
rust: nightly-2019-08-21 # minimum required version for async/await
|
||||
|
||||
before_install:
|
||||
- cargo install mdbook --vers '0.3.1' --debug --force
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
|
||||
use {
|
||||
futures::{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
|
||||
use futures::executor::block_on;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
|
||||
// ANCHOR: imports
|
||||
use {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(async_await)]
|
||||
|
||||
// ANCHOR: imports
|
||||
use {
|
||||
std::{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
|
||||
// ANCHOR: imports
|
||||
use {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#![allow(unused)]
|
||||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
|
||||
mod async_fn_and_block_examples {
|
||||
use std::future::Future;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
|
||||
mod stream_trait {
|
||||
use {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
|
||||
use {
|
||||
futures::{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
|
||||
struct Book;
|
||||
struct Music;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(test)]
|
||||
#![feature(async_await)]
|
||||
#![recursion_limit="128"]
|
||||
|
||||
mod example {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
The asynchronous Rust ecosystem has undergone a lot of evolution over time,
|
||||
so it can be hard to know what tools to use, what libraries to invest in,
|
||||
or what documentation to read. However, the `Future` trait inside the standard
|
||||
library has recently been stabilized, and the `async`/`await` feature will
|
||||
follow shortly. The ecosystem as a whole is therefore in the midst of migrating
|
||||
library and the `async`/`await` language feature has recently been stabilized.
|
||||
The ecosystem as a whole is therefore in the midst of migrating
|
||||
to the newly-stabilized API, after which point churn will be significantly
|
||||
reduced.
|
||||
|
||||
|
|
|
@ -16,17 +16,7 @@ Let's add some dependencies to the `Cargo.toml` file:
|
|||
```
|
||||
|
||||
Now that we've got our dependencies out of the way, let's start writing some
|
||||
code. Open up `src/main.rs` and enable the `async_await` feature at the top of
|
||||
the file:
|
||||
|
||||
```rust
|
||||
#![feature(async_await)]
|
||||
```
|
||||
|
||||
This adds support for the nightly-only but soon-to-be-stabilized
|
||||
`async`/`await` syntax.
|
||||
|
||||
Additionally, we have some imports to add:
|
||||
code. We have some imports to add:
|
||||
|
||||
```rust
|
||||
{{#include ../../examples/01_05_http_server/src/lib.rs:imports}}
|
||||
|
|
Loading…
Reference in New Issue