diff --git a/hello-async/src/main.rs b/hello-async/src/main.rs index 6bc2e81..a42a94e 100644 --- a/hello-async/src/main.rs +++ b/hello-async/src/main.rs @@ -1,7 +1,15 @@ use trpl::Html; fn main() { - println!("Hello, world!"); + let args: Vec<String> = std::env::args().collect(); + + trpl::run(async { + let url = &args[1]; + match page_title(url).await { + Some(title) => println!("The title for {url} was {title}"), + None => println!("{url} had no title"), + } + }) } async fn page_title(url: &str) -> Option<String> {