@@ -131,7 +131,7 @@ Notice that Rust’s `await` keyword goes _after_ the expression you’re awaiti
131
131
not before it. That is, it’s a _ postfix_ keyword. This may differ from what
132
132
you’re used to if you’ve used ` async ` in other languages, but in Rust it makes
133
133
chains of methods much nicer to work with. As a result, we can change the body
134
- of ` page_url_for ` to chain the ` trpl::get ` and ` text ` function calls together
134
+ of ` page_title ` to chain the ` trpl::get ` and ` text ` function calls together
135
135
with ` await ` between them, as shown in Listing 17-2.
136
136
137
137
<Listing number =" 17-2 " file-name =" src/main.rs " caption =" Chaining with the `await` keyword " >
@@ -319,7 +319,7 @@ function in `main` to set up a runtime and run the future returned by the
319
319
320
320
> Note: Some runtimes provide macros so you _ can_ write an async ` main `
321
321
> function. Those macros rewrite ` async fn main() { ... } ` to be a normal `fn
322
- > main`, which does the same thing we did by hand in Listing 17-5 : call a
322
+ > main`, which does the same thing we did by hand in Listing 17-4 : call a
323
323
> function that runs a future to completion the way ` trpl::run ` does.
324
324
325
325
Now let’s put these pieces together and see how we can write concurrent code.
@@ -364,10 +364,11 @@ enum Either<A, B> {
364
364
}
365
365
```
366
366
367
- The ` race ` function returns ` Left ` with that future’s output if the first
368
- argument wins, and ` Right ` with the second future argument’s output if _ that_
369
- one wins. This matches the order the arguments appear in when calling the
370
- function: the first argument is to the left of the second argument.
367
+ The ` race ` function returns ` Left ` with the output from the first future
368
+ argument it finishes first, or ` Right ` with the output of the second future
369
+ argument if that one finishes first. This matches the order the arguments appear
370
+ in when calling the function: the first argument is to the left of the second
371
+ argument.
371
372
372
373
We also update ` page_title ` to return the same URL passed in. That way, if
373
374
the page that returns first does not have a ` <title> ` we can resolve, we can
0 commit comments