From e57d932042cd1b8629547b8b06bf596ba35e284e Mon Sep 17 00:00:00 2001 From: Syfaro Date: Sun, 21 Feb 2021 00:38:48 -0500 Subject: [PATCH] Derive more for types. --- fuzzysearch-common/src/types.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fuzzysearch-common/src/types.rs b/fuzzysearch-common/src/types.rs index 50a5a03..5ad892b 100644 --- a/fuzzysearch-common/src/types.rs +++ b/fuzzysearch-common/src/types.rs @@ -1,6 +1,6 @@ -use serde::Serialize; +use serde::{Deserialize, Serialize}; -#[derive(Debug, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] #[serde(rename_all = "lowercase")] pub enum Rating { General, @@ -24,7 +24,7 @@ impl std::str::FromStr for Rating { } /// A general type for every result in a search. -#[derive(Debug, Default, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SearchResult { pub id: i32, @@ -49,7 +49,7 @@ pub struct SearchResult { pub searched_hash: Option, } -#[derive(Debug, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "site", content = "site_info")] pub enum SiteInfo { FurAffinity {