diff options
Diffstat (limited to 'examples/custom_host.rs')
-rw-r--r-- | examples/custom_host.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/examples/custom_host.rs b/examples/custom_host.rs index 3b1fd3e..8b06eae 100644 --- a/examples/custom_host.rs +++ b/examples/custom_host.rs @@ -1,13 +1,10 @@ -use futures::Future; use shiplift::Docker; -fn main() { +#[tokio::main] +async fn main() { let docker = Docker::host("http://yourhost".parse().unwrap()); - - let fut = docker - .ping() - .map(|pong| println!("Ping: {}", pong)) - .map_err(|e| eprintln!("Error: {}", e)); - - tokio::run(fut); + match docker.ping().await { + Ok(pong) => println!("Ping: {}", pong), + Err(e) => eprintln!("Error: {}", e), + } } |