From 56e1022da6f260eb5a91e9de090b58d9dbd58cf2 Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 2 Mar 2022 23:39:44 +0300 Subject: database: code cleanup --- src/database/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/database/mod.rs') diff --git a/src/database/mod.rs b/src/database/mod.rs index 836d6c3..e7baaa8 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -4,8 +4,11 @@ use serde::{Deserialize, Serialize}; mod file; pub use crate::database::file::FileStorage; +#[cfg(test)] mod memory; -pub(crate) use crate::database::memory::MemoryStorage; +#[cfg(test)] +pub use crate::database::memory::MemoryStorage; + /// Data structure representing a Micropub channel in the ?q=channels output. #[derive(Serialize, Deserialize, PartialEq, Debug)] @@ -44,6 +47,8 @@ pub struct StorageError { kind: ErrorKind, } +impl warp::reject::Reject for StorageError {} + impl std::error::Error for StorageError { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { self.source -- cgit 1.4.1