Chain asynchronous calls
This commit is contained in:
parent
c3e466fc23
commit
6e852c6c60
1 changed files with 1 additions and 2 deletions
|
@ -5,8 +5,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn page_title(url: &str) -> Option<String> {
|
async fn page_title(url: &str) -> Option<String> {
|
||||||
let response = trpl::get(url).await;
|
let response_text = trpl::get(url).await.text().await;
|
||||||
let response_text = response.text().await;
|
|
||||||
Html::parse(&response_text)
|
Html::parse(&response_text)
|
||||||
.select_first("title")
|
.select_first("title")
|
||||||
.map(|title_element| title_element.inner_html())
|
.map(|title_element| title_element.inner_html())
|
||||||
|
|
Loading…
Reference in a new issue