Skip to content

Commit 658ce12

Browse files
funkillcramertj
authored andcommitted
ignore running some code, fix edition for other part of code
1 parent 15281c6 commit 658ce12

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/01_getting_started/02_why_async.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ thread. In a typical threaded application, if you wanted to download two
88
different webpages at the same time, you would spread the work across two
99
different threads, like this:
1010

11-
```rust
11+
```rust,ignore
1212
{{#include ../../examples/01_02_why_async/src/lib.rs:get_two_sites}}
1313
```
1414

@@ -22,7 +22,7 @@ to eliminate. We can rewrite the function above using Rust's
2222
`async`/`.await` notation, which will allow us to run multiple tasks at
2323
once without creating multiple threads:
2424

25-
```rust
25+
```rust,ignore
2626
{{#include ../../examples/01_02_why_async/src/lib.rs:get_two_sites_async}}
2727
```
2828

src/01_getting_started/04_async_await_primer.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ blocked `Future`s will yield control of the thread, allowing other
99

1010
To create an asynchronous function, you can use the `async fn` syntax:
1111

12-
```rust
13-
async fn do_something() { ... }
12+
```rust,edition2018
13+
async fn do_something() { /* ... */ }
1414
```
1515

1616
The value returned by `async fn` is a `Future`. For anything to happen,
1717
the `Future` needs to be run on an executor.
1818

19-
```rust
19+
```rust,edition2018
2020
{{#include ../../examples/01_04_async_await_primer/src/lib.rs:hello_world}}
2121
```
2222

@@ -29,16 +29,16 @@ other tasks to run if the future is currently unable to make progress.
2929
For example, imagine that we have three `async fn`: `learn_song`, `sing_song`,
3030
and `dance`:
3131

32-
```rust
33-
async fn learn_song() -> Song { ... }
34-
async fn sing_song(song: Song) { ... }
35-
async fn dance() { ... }
32+
```rust,ignore
33+
async fn learn_song() -> Song { /* ... */ }
34+
async fn sing_song(song: Song) { /* ... */ }
35+
async fn dance() { /* ... */ }
3636
```
3737

3838
One way to do learn, sing, and dance would be to block on each of these
3939
individually:
4040

41-
```rust
41+
```rust,ignore
4242
{{#include ../../examples/01_04_async_await_primer/src/lib.rs:block_on_each}}
4343
```
4444

@@ -48,7 +48,7 @@ we can sing it, but it's possible to dance at the same time as learning and
4848
singing the song. To do this, we can create two separate `async fn` which
4949
can be run concurrently:
5050

51-
```rust
51+
```rust,ignore
5252
{{#include ../../examples/01_04_async_await_primer/src/lib.rs:block_on_main}}
5353
```
5454

src/01_getting_started/05_http_server_example.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Let's add some dependencies to the `Cargo.toml` file:
1515
Now that we've got our dependencies out of the way, let's start writing some
1616
code. We have some imports to add:
1717

18-
```rust
18+
```rust,ignore
1919
{{#include ../../examples/01_05_http_server/src/lib.rs:imports}}
2020
```
2121

2222
Once the imports are out of the way, we can start putting together the
2323
boilerplate to allow us to serve requests:
2424

25-
```rust
25+
```rust,ignore
2626
{{#include ../../examples/01_05_http_server/src/lib.rs:boilerplate}}
2727
```
2828

@@ -35,7 +35,7 @@ You can also inspect the request itself, which contains information such as
3535
the request URI, HTTP version, headers, and other metadata. For example, we
3636
can print out the URI of the request like this:
3737

38-
```rust
38+
```rust,ignore
3939
println!("Got request at {:?}", req.uri());
4040
```
4141

@@ -47,14 +47,14 @@ request to another website using Hyper's HTTP client.
4747

4848
We start by parsing out the URL we want to request:
4949

50-
```rust
50+
```rust,ignore
5151
{{#include ../../examples/01_05_http_server/src/lib.rs:parse_url}}
5252
```
5353

5454
Then we can create a new `hyper::Client` and use it to make a `GET` request,
5555
returning the response to the user:
5656

57-
```rust
57+
```rust,ignore
5858
{{#include ../../examples/01_05_http_server/src/lib.rs:get_request}}
5959
```
6060

0 commit comments

Comments
 (0)