summaryrefslogtreecommitdiffstats
path: root/examples/volumes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/volumes.rs')
-rw-r--r--examples/volumes.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/examples/volumes.rs b/examples/volumes.rs
index c5548ec..d45c00a 100644
--- a/examples/volumes.rs
+++ b/examples/volumes.rs
@@ -1,18 +1,16 @@
use shiplift::Docker;
-use tokio::prelude::Future;
-fn main() {
+#[tokio::main]
+async fn main() {
let docker = Docker::new();
let volumes = docker.volumes();
- let fut = volumes
- .list()
- .map(|volumes| {
+ match volumes.list().await {
+ Ok(volumes) => {
for v in volumes {
println!("volume -> {:#?}", v)
}
- })
- .map_err(|e| eprintln!("Error: {}", e));
-
- tokio::run(fut);
+ }
+ Err(e) => eprintln!("Error: {}", e),
+ }
}