From a727690e8bb8231e45eda4f0e7af03ed148d3134 Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Sat, 14 Oct 2023 16:46:27 +0900 Subject: [PATCH] fix: removed AllFieldInfo trim newline char to be same ScriptBlock value AllFieldInfo and Details #1189 --- src/detections/utils.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detections/utils.rs b/src/detections/utils.rs index 7e618c549..753d90fea 100644 --- a/src/detections/utils.rs +++ b/src/detections/utils.rs @@ -73,7 +73,7 @@ pub fn value_to_string(value: &Value) -> Option { Value::Null => Option::None, Value::Bool(b) => Option::Some(b.to_string()), Value::Number(n) => Option::Some(n.to_string()), - Value::String(s) => Option::Some(s.trim().to_string()), + Value::String(s) => Option::Some(s.to_string()), Value::Array(_) => Option::None, Value::Object(_) => Option::None, } @@ -448,7 +448,7 @@ fn _collect_recordinfo<'a>( // 一番子の要素の値しか収集しない let strval = value_to_string(value); if let Some(strval) = strval { - let strval = strval.trim().chars().fold(String::default(), |mut acc, c| { + let strval = strval.chars().fold(String::default(), |mut acc, c| { if (c.is_control() || c.is_ascii_whitespace()) && !['\r', '\n', '\t'].contains(&c) {