summaryrefslogtreecommitdiffstats
path: root/examples/imagetag.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/imagetag.rs')
-rw-r--r--examples/imagetag.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/imagetag.rs b/examples/imagetag.rs
index 7ae78dd..e36af76 100644
--- a/examples/imagetag.rs
+++ b/examples/imagetag.rs
@@ -2,9 +2,9 @@
use shiplift::{Docker, Image, TagOptions};
use std::env;
-use tokio::prelude::Future;
-fn main() {
+#[tokio::main]
+async fn main() {
env_logger::init();
let docker = Docker::new();
let img = env::args()
@@ -21,7 +21,7 @@ fn main() {
let image = Image::new(&docker, img);
- let fut = image.tag(&tag_opts).map_err(|e| eprintln!("Error: {}", e));
-
- tokio::run(fut);
+ if let Err(e) = image.tag(&tag_opts).await {
+ eprintln!("Error: {}", e)
+ }
}