summaryrefslogtreecommitdiff
path: root/crates/control
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-10-01 15:42:50 +0100
committertcmal <me@aria.rip>2024-10-11 23:57:19 +0100
commit34572a8f3839e37063641fa693029ad52265730a (patch)
treedd81dfba798039acb638aa1945a58cff023f1c38 /crates/control
parentd7275a13989b82ea8fc7b2320ef0cf2f427f7d5d (diff)
Stricter clippy lints
Diffstat (limited to 'crates/control')
-rw-r--r--crates/control/src/lib.rs10
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!(),
}
}
}