You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_url_for 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_url_for, but the function is called page_title. The term page_url_for 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 page_title.
The text was updated successfully, but these errors were encountered:
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_url_for 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_url_for, but the function is called page_title. The term page_url_for 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 page_title.
The text was updated successfully, but these errors were encountered: