From 596aed17bd6d48eecca97ecc1818075e21b63bbf Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 10 Dec 2019 15:53:22 +0100 Subject: Replace invalid example in README with cargo example (#207) The example in the README is outdated and no longer compiles. To prevent this from happening again, this patch removes the example entirely and instead introduces a new example `custom_host` that will be checked during `cargo test`. Fixes #183. --- examples/custom_host.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/custom_host.rs (limited to 'examples') diff --git a/examples/custom_host.rs b/examples/custom_host.rs new file mode 100644 index 0000000..3b1fd3e --- /dev/null +++ b/examples/custom_host.rs @@ -0,0 +1,13 @@ +use futures::Future; +use shiplift::Docker; + +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); +} -- cgit v1.2.3