diff options
Diffstat (limited to 'examples/imagesearch.rs')
-rw-r--r-- | examples/imagesearch.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/imagesearch.rs b/examples/imagesearch.rs index a6d6e52..e2fd110 100644 --- a/examples/imagesearch.rs +++ b/examples/imagesearch.rs @@ -1,17 +1,16 @@ use shiplift::Docker; -use tokio::prelude::Future; -fn main() { +#[tokio::main] +async fn main() { let docker = Docker::new(); println!("remote docker images in stock"); - let fut = docker - .images() - .search("rust") - .map(|results| { + + match docker.images().search("rust").await { + Ok(results) => { for result in results { println!("{} - {}", result.name, result.description); } - }) - .map_err(|e| eprintln!("Error: {}", e)); - tokio::run(fut); + } + Err(e) => eprintln!("Error: {}", e), + } } |