Description of the problem:
In Chapter 17.1 Futures and the Async Syntax, we create a function to demonstrate the async syntax:
use trpl::Html;
async fn page_title(url: &str) -> Option<String> {
let response = trpl::get(url).await;
let response_text = response.text().await;
Html::parse(&response_text)
.select_first("title")
.map(|title_element| title_element.inner_html())
}
Later on in the page, we refer back to this function with the suggestion to modify it.
_As a result, we can change the body of page_urlfor to chain the trpl::get and text function calls together with await between them, as shown in Listing 17-2:
The above sentence implies that the function we should modify is _page_urlfor, but the function is called _pagetitle. The term _page_urlfor does not show up anywhere in Chapter 17.
Suggested fix:
Change the sentence listed above in Chapter 17.1 to refer to the function as _pagetitle.
I have searched open and closed issues and pull requests for duplicates, using these search terms:
I have checked the latest
main
branch to see if this has already been fixed, in this file:URL to the section(s) of the book with this problem: https://rust-book.cs.brown.edu/ch17-01-futures-and-syntax.html
Description of the problem: In Chapter 17.1 Futures and the Async Syntax, we create a function to demonstrate the async syntax:
Later on in the page, we refer back to this function with the suggestion to modify it.
_As a result, we can change the body of page_urlfor to chain the trpl::get and text function calls together with await between them, as shown in Listing 17-2:
The above sentence implies that the function we should modify is _page_urlfor, but the function is called _pagetitle. The term _page_urlfor does not show up anywhere in Chapter 17.
Suggested fix: Change the sentence listed above in Chapter 17.1 to refer to the function as _pagetitle.