You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
398 B

extern crate trpl; // required for mdbook test
use trpl::Html;
fn main() {
// TODO: we'll add this next!
}
async fn page_title(url: &str) -> Option<String> {
// ANCHOR: chaining
let response_text = trpl::get(url).await.text().await;
// ANCHOR_END: chaining
Html::parse(&response_text)
.select_first("title")
.map(|title_element| title_element.inner_html())
}