summaryrefslogtreecommitdiffstats
path: root/examples/containers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/containers.rs')
-rw-r--r--examples/containers.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/examples/containers.rs b/examples/containers.rs
index 0eb51af..72de140 100644
--- a/examples/containers.rs
+++ b/examples/containers.rs
@@ -1,18 +1,15 @@
use shiplift::Docker;
-use tokio::prelude::Future;
-fn main() {
+#[tokio::main]
+async fn main() {
env_logger::init();
let docker = Docker::new();
- let fut = docker
- .containers()
- .list(&Default::default())
- .map(|containers| {
+ match docker.containers().list(&Default::default()).await {
+ Ok(containers) => {
for c in containers {
println!("container -> {:#?}", c)
}
- })
- .map_err(|e| eprintln!("Error: {}", e));
-
- tokio::run(fut);
+ }
+ Err(e) => eprintln!("Error: {}", e),
+ }
}