diff --git a/client/Cargo.toml b/client/Cargo.toml index 4d2d046..4412f80 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -1,3 +1,7 @@ +[[bin]] +name = "navka-client" +path = "src/main.rs" + [package] name = "navka_client" version = "0.3.0" diff --git a/client/src/app.rs b/client/src/app.rs index 0c17221..fc1f52f 100644 --- a/client/src/app.rs +++ b/client/src/app.rs @@ -43,7 +43,10 @@ impl NavkaClientApp { pub async fn run(&mut self) -> Result<()> { /* detach the aggregator before spawn so `self` is not moved */ let aggregator = self.aggregator.take().expect("InputAggregator present"); - let agg_task = tokio::spawn(async move { aggregator.run().await }); + let agg_task = tokio::spawn(async move { + let mut agg = aggregator; + agg.run().await + }); /* two networking tasks */ let kbd_loop = self.stream_loop_keyboard(); diff --git a/client/src/input/keyboard.rs b/client/src/input/keyboard.rs index b6e2a5d..eaf5772 100644 --- a/client/src/input/keyboard.rs +++ b/client/src/input/keyboard.rs @@ -24,8 +24,7 @@ impl KeyboardAggregator { pub fn process_events(&mut self) { // --- first fetch, then log (avoids aliasing borrow) --- - let result = self.dev.fetch_events(); - let events: Vec = match result { + let events: Vec = match self.dev.fetch_events() { Ok(it) => it.collect(), Err(e) if e.kind() == std::io::ErrorKind::WouldBlock => return, Err(e) => { if self.dev_mode { error!("read error: {e}"); } return } diff --git a/client/src/input/mouse.rs b/client/src/input/mouse.rs index 539f1fe..85166c4 100644 --- a/client/src/input/mouse.rs +++ b/client/src/input/mouse.rs @@ -26,8 +26,7 @@ impl MouseAggregator { #[inline] fn slog(&self, f: impl FnOnce()) { if self.dev_mode { f() } } pub fn process_events(&mut self) { - let result = self.dev.fetch_events(); - let evts: Vec = match result { + let evts: Vec = match self.dev.fetch_events() { Ok(it) => it.collect(), Err(e) if e.kind() == std::io::ErrorKind::WouldBlock => return, Err(e) => { if self.dev_mode { error!("mouse read err: {e}"); } return } diff --git a/common/Cargo.toml b/common/Cargo.toml index 2423a03..a5f7dd4 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,3 +1,7 @@ +[[bin]] +name = "navka-common" +path = "build.rs" + [package] name = "navka_common" version = "0.1.0" diff --git a/server/Cargo.toml b/server/Cargo.toml index e5e2abe..143c739 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,3 +1,7 @@ +[[bin]] +name = "navka-server" +path = "src/main.rs" + [package] name = "navka_server" version = "0.2.0"