From 435b05949ebc2396876cbb35aabb9648474e6bf6 Mon Sep 17 00:00:00 2001 From: 0xf8 <0xf8.dev@proton.me> Date: Thu, 20 Apr 2023 18:10:37 -0400 Subject: [PATCH] Fix KeywordSection::load not deserializing correctly --- src/keywords.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/keywords.rs b/src/keywords.rs index 4b41251..21bd6ef 100644 --- a/src/keywords.rs +++ b/src/keywords.rs @@ -5,7 +5,8 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Deserialize, Serialize)] pub struct KeywordSection { pub threshold: u64, - pub requiredKeywords: Vec, + #[serde(rename = "requiredKeywords")] + pub required: Vec, pub keywords: Vec, } @@ -27,7 +28,7 @@ impl KeywordSection { } } - for rkw in self.requiredKeywords.to_owned() { + for rkw in self.required.to_owned() { if s.contains(&rkw) { hits += 1; hit_required = true;