From c0ac07f743c82ff24c0bb185e7cad3fc8aa25a4f Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Thu, 2 May 2024 22:41:39 +0900 Subject: [PATCH] chore: fixed clippy lint warning #1335 --- src/afterfact.rs | 10 +++++++--- src/detections/utils.rs | 4 ++-- src/main.rs | 1 - 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/afterfact.rs b/src/afterfact.rs index 1cdd3d463..d8efaf5f7 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -380,7 +380,9 @@ fn emit_csv_inner( remove_duplicate_data, ); afterfact_info.prev_message = result.1; - afterfact_info.prev_details_convert_map = detect_info.details_convert_map.clone(); + afterfact_info + .prev_details_convert_map + .clone_from(&detect_info.details_convert_map); if afterfact_writer.display_flag { write_color_buffer( &afterfact_writer.disp_wtr, @@ -404,7 +406,9 @@ fn emit_csv_inner( remove_duplicate_data, ); afterfact_info.prev_message = result.1; - afterfact_info.prev_details_convert_map = detect_info.details_convert_map.clone(); + afterfact_info + .prev_details_convert_map + .clone_from(&detect_info.details_convert_map); if afterfact_writer.display_flag { write_color_buffer( &afterfact_writer.disp_wtr, @@ -1806,7 +1810,7 @@ pub fn output_json_str( } } } else { - target_ext_field = detect_info.ext_field.to_owned(); + target_ext_field.clone_from(&detect_info.ext_field); } let key_add_to_details = [ "SrcASN", diff --git a/src/detections/utils.rs b/src/detections/utils.rs index 5b44a8b1c..6d93c2241 100644 --- a/src/detections/utils.rs +++ b/src/detections/utils.rs @@ -332,10 +332,10 @@ pub fn create_rec_info( if !*no_pwsh_field_extraction { if key == "EventID" { - event_id = val.clone(); + event_id.clone_from(&val); } if key == "Channel" { - channel = val.clone(); + channel.clone_from(&val); } } key_2_values.insert(key.to_string(), val.unwrap()); diff --git a/src/main.rs b/src/main.rs index b04735640..aba878ef2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,7 +53,6 @@ use std::path::Path; use std::ptr::null_mut; use std::sync::Arc; use std::time::Duration; -use std::u128; use std::{ env, fs::{self, File},