diff options
Diffstat (limited to 'crates/control')
-rw-r--r-- | crates/control/src/lib.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/control/src/lib.rs b/crates/control/src/lib.rs index 5691cf2..f0226f9 100644 --- a/crates/control/src/lib.rs +++ b/crates/control/src/lib.rs @@ -4,6 +4,8 @@ //! in a separate thread, on its own async executor. //! //! The main server spawns this thread by creating a [`Handle`] and communicates by sending [messages](crate::Message) over an MPSC channel. +#![deny(clippy::all, clippy::pedantic, clippy::nursery)] +#![allow(clippy::must_use_candidate, clippy::missing_errors_doc)] use std::{ mem::ManuallyDrop, @@ -21,6 +23,7 @@ const CHANNEL_CAPACITY: usize = 100; /// A control message sent from the API to the printer control thread pub enum Message { + Todo, Quit, } @@ -32,6 +35,8 @@ pub struct Handle { impl Handle { /// Spawn a printer control thread, returning a handle + /// # Panics + /// If there is an error spawning the control thread pub fn spawn() -> Self { let (send, recv) = mpsc::channel(CHANNEL_CAPACITY); @@ -58,8 +63,8 @@ impl Drop for Handle { info!("waiting for printer thread to exit..."); ManuallyDrop::take(&mut self.thread_handle) .join() - .expect("error joining printer thread") - }; + .expect("error joining printer thread"); + } } } @@ -75,6 +80,7 @@ impl State { while let Some(msg) = self.cmd_recv.recv().await { match msg { Message::Quit => break, + Message::Todo => todo!(), } } } |