diff options
-rw-r--r-- | Cargo.toml | 8 | ||||
-rw-r--r-- | examples/chat/client.rs (renamed from examples/terminal_chat_client/main.rs) | 6 | ||||
-rw-r--r-- | examples/chat/protocol.rs (renamed from examples/chat_protocol/lib.rs) | 0 | ||||
-rw-r--r-- | examples/chat/server.rs (renamed from examples/chat_server/main.rs) | 5 |
4 files changed, 13 insertions, 6 deletions
@@ -31,3 +31,11 @@ rand = "0.8.5" [[example]] name = "breakout" path = "examples/breakout/breakout.rs" + +[[example]] +name = "chat-server" +path = "examples/chat/server.rs" + +[[example]] +name = "chat-client" +path = "examples/chat/client.rs" diff --git a/examples/terminal_chat_client/main.rs b/examples/chat/client.rs index 998fcd4..b0f330d 100644 --- a/examples/terminal_chat_client/main.rs +++ b/examples/chat/client.rs @@ -16,12 +16,12 @@ use bevy_quinnet::{ }, ClientId, }; -use chat_protocol::{ClientMessage, ServerMessage}; use rand::{distributions::Alphanumeric, Rng}; use tokio::sync::mpsc; -#[path = "../chat_protocol/lib.rs"] // Because we can't have a shared lib between Cargo examples -mod chat_protocol; +use protocol::{ClientMessage, ServerMessage}; + +mod protocol; #[derive(Debug, Clone, Default)] struct Users { diff --git a/examples/chat_protocol/lib.rs b/examples/chat/protocol.rs index 6a51e50..6a51e50 100644 --- a/examples/chat_protocol/lib.rs +++ b/examples/chat/protocol.rs diff --git a/examples/chat_server/main.rs b/examples/chat/server.rs index df953b0..26fa75e 100644 --- a/examples/chat_server/main.rs +++ b/examples/chat/server.rs @@ -9,10 +9,9 @@ use bevy_quinnet::{ ClientId, }; -use chat_protocol::{ClientMessage, ServerMessage}; +use protocol::{ClientMessage, ServerMessage}; -#[path = "../chat_protocol/lib.rs"] // Because we can't have a shared lib between Cargo examples -mod chat_protocol; +mod protocol; #[derive(Debug, Clone, Default)] struct Users { |