diff options
Diffstat (limited to 'src')
-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 |
3 files changed, 7 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()) } } 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, |