diff options
author | Vika <vika@fireburn.ru> | 2025-04-09 23:24:33 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2025-04-09 23:31:57 +0300 |
commit | 519cadfbb298f50cbf819dde757037ab56e2863e (patch) | |
tree | 9926cbca2ae8113f9ff3db6d39e2a50d73cd3cc4 | |
parent | 005efec015b3337e62037115d9fad05304161f97 (diff) | |
download | kittybox-519cadfbb298f50cbf819dde757037ab56e2863e.tar.zst |
Small fry clippy lints
Change-Id: I4b0bed232d6274d161bebafcee9ac22a63c01772
-rw-r--r-- | build.rs | 2 | ||||
-rw-r--r-- | src/database/file/mod.rs | 3 | ||||
-rw-r--r-- | src/database/memory.rs | 7 | ||||
-rw-r--r-- | src/media/storage/mod.rs | 1 | ||||
-rw-r--r-- | templates/src/templates.rs | 1 |
5 files changed, 9 insertions, 5 deletions
diff --git a/build.rs b/build.rs index 05eca7a..dcfa332 100644 --- a/build.rs +++ b/build.rs @@ -24,7 +24,7 @@ fn main() { for file in ["index.html", "style.css"] { std::fs::copy( companion_in.join(file), - &companion_out.join(file) + companion_out.join(file) ).unwrap(); } } diff --git a/src/database/file/mod.rs b/src/database/file/mod.rs index db9bb22..b9f27b2 100644 --- a/src/database/file/mod.rs +++ b/src/database/file/mod.rs @@ -603,6 +603,7 @@ impl Storage for FileStorage { // Broken links return None, and Stream::filter_map skips Nones. .try_filter_map(|post: Option<serde_json::Value>| async move { Ok(post) }) .and_then(|mut post| async move { + // XXX: N+1 problem, potential sanitization issues hydrate_author(&mut post, user, self).await; Ok(post) }) @@ -758,6 +759,6 @@ impl Storage for FileStorage { async fn all_posts<'this>(&'this self, user: &url::Url) -> Result<impl futures::Stream<Item = serde_json::Value> + Send + 'this> { todo!(); - Ok(futures::stream::empty()) // for type inference + #[allow(unreachable_code)] Ok(futures::stream::empty()) // for type inference } } diff --git a/src/database/memory.rs b/src/database/memory.rs index 412deef..c2ceb85 100644 --- a/src/database/memory.rs +++ b/src/database/memory.rs @@ -1,4 +1,4 @@ -#![allow(clippy::todo)] +#![allow(clippy::todo, missing_docs)] use futures_util::FutureExt; use serde_json::json; use std::collections::HashMap; @@ -8,6 +8,7 @@ use tokio::sync::RwLock; use crate::database::{ErrorKind, MicropubChannel, Result, settings, Storage, StorageError}; #[derive(Clone, Debug, Default)] +/// A simple in-memory store for testing purposes. pub struct MemoryStorage { pub mapping: Arc<RwLock<HashMap<String, serde_json::Value>>>, pub channels: Arc<RwLock<HashMap<url::Url, Vec<String>>>>, @@ -239,9 +240,9 @@ impl Storage for MemoryStorage { todo!() } - async fn all_posts<'this>(&'this self, user: &url::Url) -> Result<impl futures::Stream<Item = serde_json::Value> + Send + 'this> { + async fn all_posts<'this>(&'this self, _user: &url::Url) -> Result<impl futures::Stream<Item = serde_json::Value> + Send + 'this> { todo!(); - Ok(futures::stream::pending()) + #[allow(unreachable_code)] Ok(futures::stream::pending()) } } diff --git a/src/media/storage/mod.rs b/src/media/storage/mod.rs index 551b61e..3583247 100644 --- a/src/media/storage/mod.rs +++ b/src/media/storage/mod.rs @@ -97,6 +97,7 @@ pub trait MediaStore: 'static + Send + Sync + Clone { where T: tokio_stream::Stream<Item = std::result::Result<bytes::Bytes, axum::extract::multipart::MultipartError>> + Unpin + Send + Debug; + #[allow(clippy::type_complexity)] fn read_streaming( &self, domain: &str, diff --git a/templates/src/templates.rs b/templates/src/templates.rs index 9b29fce..d2734f8 100644 --- a/templates/src/templates.rs +++ b/templates/src/templates.rs @@ -1,3 +1,4 @@ +#![allow(clippy::needless_lifetimes)] use http::StatusCode; use kittybox_util::micropub::Channel; use crate::{Feed, VCard}; |