diff options
author | Eliza Weisman <eliza@buoyant.io> | 2019-03-22 15:25:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 15:25:42 -0700 |
commit | 30330da11a56dfdd11bdbef50dba073a9edc36b2 (patch) | |
tree | bf4e8e90293a3c75a2bf5281572e1c01eceab3cb | |
parent | 6e4945025cdc6f2b71d9b30aaa23c5517cca1504 (diff) |
chore: Fix examples not working with `cargo run` (#998)
* chore: Fix examples not working with `cargo run`
## Motivation
PR #991 moved the `tokio` crate to its own subdirectory, but did not
move the `examples` directory into `tokio/examples`. While attempting to
use the examples for testing another change, I noticed that #991 had
broken the ability to use `cargo run`, as the examples were no longer
considered part of a crate that cargo was aware of:
```
tokio on master [$] via 🦀v1.33.0 at ☸️ aks-eliza-dev
➜ cargo run --example chat
error: no example target named `chat`
Did you mean `echo`?
```
## Solution
This branch moves the examples into the `tokio` directory, so cargo is
now once again aware of them:
```
tokio on eliza/fix-examples [$] via 🦀v1.33.0 at ☸️ aks-eliza-dev
➜ cargo run --example chat
Compiling tokio-executor v0.1.7 (/Users/eliza/Code/tokio/tokio-executor)
Compiling tokio-reactor v0.1.9
Compiling tokio-threadpool v0.1.13
Compiling tokio-current-thread v0.1.6
Compiling tokio-timer v0.2.10
Compiling tokio-uds v0.2.5
Compiling tokio-udp v0.1.3
Compiling tokio-tcp v0.1.3
Compiling tokio-fs v0.1.6
Compiling tokio v0.1.18 (/Users/eliza/Code/tokio/tokio)
Finished dev [unoptimized + debuginfo] target(s) in 7.04s
Running `target/debug/examples/chat`
server running on localhost:6142
```
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | tokio/examples/README.md (renamed from examples/README.md) | 0 | ||||
-rw-r--r-- | tokio/examples/chat-combinator-current-thread.rs (renamed from examples/chat-combinator-current-thread.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/chat-combinator.rs (renamed from examples/chat-combinator.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/chat.rs (renamed from examples/chat.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/connect.rs (renamed from examples/connect.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/echo-udp.rs (renamed from examples/echo-udp.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/echo.rs (renamed from examples/echo.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/hello_world.rs (renamed from examples/hello_world.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/manual-runtime.rs (renamed from examples/manual-runtime.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/print_each_packet.rs (renamed from examples/print_each_packet.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/proxy.rs (renamed from examples/proxy.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/tinydb.rs (renamed from examples/tinydb.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/tinyhttp.rs (renamed from examples/tinyhttp.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/udp-client.rs (renamed from examples/udp-client.rs) | 0 | ||||
-rw-r--r-- | tokio/examples/udp-codec.rs (renamed from examples/udp-codec.rs) | 0 |
16 files changed, 1 insertions, 1 deletions
@@ -98,7 +98,7 @@ fn main() { } ``` -More examples can be found [here](examples). +More examples can be found [here](tokio/examples). ## Getting Help diff --git a/examples/README.md b/tokio/examples/README.md index 63634c82..63634c82 100644 --- a/examples/README.md +++ b/tokio/examples/README.md diff --git a/examples/chat-combinator-current-thread.rs b/tokio/examples/chat-combinator-current-thread.rs index ee147025..ee147025 100644 --- a/examples/chat-combinator-current-thread.rs +++ b/tokio/examples/chat-combinator-current-thread.rs diff --git a/examples/chat-combinator.rs b/tokio/examples/chat-combinator.rs index b81e8f7c..b81e8f7c 100644 --- a/examples/chat-combinator.rs +++ b/tokio/examples/chat-combinator.rs diff --git a/examples/chat.rs b/tokio/examples/chat.rs index b21432af..b21432af 100644 --- a/examples/chat.rs +++ b/tokio/examples/chat.rs diff --git a/examples/connect.rs b/tokio/examples/connect.rs index 4dc0ea31..4dc0ea31 100644 --- a/examples/connect.rs +++ b/tokio/examples/connect.rs diff --git a/examples/echo-udp.rs b/tokio/examples/echo-udp.rs index 93ebca79..93ebca79 100644 --- a/examples/echo-udp.rs +++ b/tokio/examples/echo-udp.rs diff --git a/examples/echo.rs b/tokio/examples/echo.rs index 45f808f8..45f808f8 100644 --- a/examples/echo.rs +++ b/tokio/examples/echo.rs diff --git a/examples/hello_world.rs b/tokio/examples/hello_world.rs index c8276269..c8276269 100644 --- a/examples/hello_world.rs +++ b/tokio/examples/hello_world.rs diff --git a/examples/manual-runtime.rs b/tokio/examples/manual-runtime.rs index 8e3e1299..8e3e1299 100644 --- a/examples/manual-runtime.rs +++ b/tokio/examples/manual-runtime.rs diff --git a/examples/print_each_packet.rs b/tokio/examples/print_each_packet.rs index 94a60648..94a60648 100644 --- a/examples/print_each_packet.rs +++ b/tokio/examples/print_each_packet.rs diff --git a/examples/proxy.rs b/tokio/examples/proxy.rs index ae8bf3a4..ae8bf3a4 100644 --- a/examples/proxy.rs +++ b/tokio/examples/proxy.rs diff --git a/examples/tinydb.rs b/tokio/examples/tinydb.rs index 11298ed1..11298ed1 100644 --- a/examples/tinydb.rs +++ b/tokio/examples/tinydb.rs diff --git a/examples/tinyhttp.rs b/tokio/examples/tinyhttp.rs index cde1b79a..cde1b79a 100644 --- a/examples/tinyhttp.rs +++ b/tokio/examples/tinyhttp.rs diff --git a/examples/udp-client.rs b/tokio/examples/udp-client.rs index 900d3616..900d3616 100644 --- a/examples/udp-client.rs +++ b/tokio/examples/udp-client.rs diff --git a/examples/udp-codec.rs b/tokio/examples/udp-codec.rs index 3657d8cc..3657d8cc 100644 --- a/examples/udp-codec.rs +++ b/tokio/examples/udp-codec.rs |