Chain asynchronous calls

This commit is contained in:
Manuel Thalmann 2025-04-03 08:22:37 +02:00
parent c3e466fc23
commit 6e852c6c60
Signed by: manuth
SSH key fingerprint: SHA256:HsMLC+7kJWALP6YCYCoopxNbUnghwSGLVcG76SECT5c

View file

@ -5,8 +5,7 @@ fn main() {
}
async fn page_title(url: &str) -> Option<String> {
let response = trpl::get(url).await;
let response_text = response.text().await;
let response_text = trpl::get(url).await.text().await;
Html::parse(&response_text)
.select_first("title")
.map(|title_element| title_element.inner_html())