summaryrefslogtreecommitdiffstats
path: root/examples/imageinspect.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/imageinspect.rs')
-rw-r--r--examples/imageinspect.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/examples/imageinspect.rs b/examples/imageinspect.rs
index 494480a..b7d2f9a 100644
--- a/examples/imageinspect.rs
+++ b/examples/imageinspect.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 imageinspect -- <image>");
- let fut = docker
- .images()
- .get(&id)
- .inspect()
- .map(|image| println!("{:#?}", image))
- .map_err(|e| eprintln!("Error: {}", e));
- tokio::run(fut);
+
+ match docker.images().get(&id).inspect().await {
+ Ok(image) => println!("{:#?}", image),
+ Err(e) => eprintln!("Error: {}", e),
+ }
}