From 402d9c13260265c5f28ba02d882ab95097b67f45 Mon Sep 17 00:00:00 2001 From: auxo Date: Mon, 7 Feb 2022 17:27:42 +0800 Subject: [PATCH 1/2] add serialization support for struct suggestions --- src/suggestion.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/suggestion.rs b/src/suggestion.rs index 7b2484f..6420d16 100644 --- a/src/suggestion.rs +++ b/src/suggestion.rs @@ -1,6 +1,7 @@ use std::cmp::Ordering; #[derive(Debug, Clone)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Suggestion { pub term: String, pub distance: i64, From 0efe019ca5b17c66158e6a0aabb99d501fbad30c Mon Sep 17 00:00:00 2001 From: auxo Date: Mon, 7 Feb 2022 17:27:42 +0800 Subject: [PATCH 2/2] add serialization for struct Suggestion. --- src/suggestion.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/suggestion.rs b/src/suggestion.rs index 7b2484f..6420d16 100644 --- a/src/suggestion.rs +++ b/src/suggestion.rs @@ -1,6 +1,7 @@ use std::cmp::Ordering; #[derive(Debug, Clone)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Suggestion { pub term: String, pub distance: i64,