diff options
Diffstat (limited to 'examples/containerinspect.rs')
-rw-r--r-- | examples/containerinspect.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/examples/containerinspect.rs b/examples/containerinspect.rs index 0f853bc..8de2a67 100644 --- a/examples/containerinspect.rs +++ b/examples/containerinspect.rs @@ -1,17 +1,15 @@ use shiplift::Docker; use std::env; -use tokio::prelude::Future; -fn main() { +#[tokio::main] +async fn main() { let docker = Docker::new(); let id = env::args() .nth(1) .expect("Usage: cargo run --example containerinspect -- <container>"); - let fut = docker - .containers() - .get(&id) - .inspect() - .map(|container| println!("{:#?}", container)) - .map_err(|e| eprintln!("Error: {}", e)); - tokio::run(fut); + + match docker.containers().get(&id).inspect().await { + Ok(container) => println!("{:#?}", container), + Err(e) => eprintln!("Error: {}", e), + } } |