diff options
author | tcmal <me@aria.rip> | 2024-10-01 15:42:50 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-10-11 23:57:19 +0100 |
commit | 34572a8f3839e37063641fa693029ad52265730a (patch) | |
tree | dd81dfba798039acb638aa1945a58cff023f1c38 /crates/control/src/lib.rs | |
parent | d7275a13989b82ea8fc7b2320ef0cf2f427f7d5d (diff) |
Stricter clippy lints
Diffstat (limited to 'crates/control/src/lib.rs')
-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!(), } } } |