chore: Clippy fixes

This commit is contained in:
Ginger committed 2026-08-25 12:37:13 -04:00
1 parent 18b0a87b2d
commit eadcea8034
14 files changed
+66 -52

No files matched your search

+3 -1
View File
@@ -49,12 +49,14 @@ impl Console {
}
}
pub async fn start(self: &Arc<Self>) {
pub fn start(self: &Arc<Self>) -> impl Future<Output = ()> {
let mut worker_join = self.worker_join.lock();
if worker_join.is_none() {
let self_ = Arc::clone(self);
_ = worker_join.insert(self.server.runtime().spawn(self_.worker()));
}
std::future::ready(())
}
pub async fn close(self: &Arc<Self>) {
+3 -3
View File
@@ -104,7 +104,7 @@ pub type ProcessorFuture = Pin<Box<dyn Future<Output = ProcessorResult> + Send>>
/// events which have digested any prior errors. The wrapping preserves whether
/// the command failed without interpreting the text. Ok(None) outputs are
/// dropped to produce no response.
pub type ProcessorResult = Result<Option<CommandOutput>, CommandOutput>;
pub type ProcessorResult = Result<Option<Box<CommandOutput>>, Box<CommandOutput>>;
/// Alias for the output structure.
pub type CommandOutput = RoomMessageEventContent;
@@ -204,7 +204,7 @@ impl Service {
.text_to_file(message_content.body())
.await
.expect("failed to create text file");
let size_u64: u64 = message_content.body().len().try_into().map_or(0, |n| n);
let size_u64: u64 = message_content.body().len().try_into().unwrap_or(0);
let mut metadata = FileInfo::new();
metadata.mimetype = Some("text/markdown".to_owned());
@@ -365,7 +365,7 @@ impl Service {
match self.process_command(command).await {
| Ok(None) => debug!("Command successful with no response"),
| Ok(Some(output)) | Err(output) => self
.handle_response(output)
.handle_response(*output)
.await
.unwrap_or_else(default_log),
}