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 /src/database | |
parent | 005efec015b3337e62037115d9fad05304161f97 (diff) | |
download | kittybox-519cadfbb298f50cbf819dde757037ab56e2863e.tar.zst |
Small fry clippy lints
Change-Id: I4b0bed232d6274d161bebafcee9ac22a63c01772
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/file/mod.rs | 3 | ||||
-rw-r--r-- | src/database/memory.rs | 7 |
2 files changed, 6 insertions, 4 deletions
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()) } } |