diff --git a/src/afterfact.rs b/src/afterfact.rs index 076b57a4..6752faa1 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -579,9 +579,8 @@ mod tests { #[test] fn test_emit_csv_output() { - let mock_ch_filter = message::create_output_filter_config( - "test_files/config/channel_abbreviations.txt", - ); + let mock_ch_filter = + message::create_output_filter_config("test_files/config/channel_abbreviations.txt"); let test_filepath: &str = "test.evtx"; let test_rulepath: &str = "test-rule.yml"; let test_title = "test_title"; diff --git a/src/detections/detection.rs b/src/detections/detection.rs index 37772e35..258ab4b4 100644 --- a/src/detections/detection.rs +++ b/src/detections/detection.rs @@ -339,8 +339,7 @@ impl Detection { make_ascii_titlecase(&mut replaced_tag) }) .collect(); - profile_converter - .insert("%MitreTags%".to_string(), techniques.join(" : ")); + profile_converter.insert("%MitreTags%".to_string(), techniques.join(" : ")); } "%OtherTags%" => { let tags: &Vec = &tag_info @@ -471,8 +470,7 @@ impl Detection { make_ascii_titlecase(&mut replaced_tag) }) .collect(); - profile_converter - .insert("%MitreTags%".to_string(), techniques.join(" : ")); + profile_converter.insert("%MitreTags%".to_string(), techniques.join(" : ")); } "%OtherTags%" => { let tags: &Vec = &tag_info diff --git a/src/detections/message.rs b/src/detections/message.rs index b5c9c248..63940876 100644 --- a/src/detections/message.rs +++ b/src/detections/message.rs @@ -90,9 +90,7 @@ lazy_static! { /// ファイルパスで記載されたtagでのフル名、表示の際に置き換えられる文字列のHashMapを作成する関数。 /// ex. attack.impact,Impact -pub fn create_output_filter_config( - path: &str, -) -> HashMap { +pub fn create_output_filter_config(path: &str) -> HashMap { let mut ret: HashMap = HashMap::new(); let read_result = utils::read_csv(path); if read_result.is_err() { @@ -584,8 +582,7 @@ mod tests { #[test] /// test of loading output filter config by mitre_tactics.txt fn test_load_mitre_tactics_log() { - let actual = - create_output_filter_config("test_files/config/mitre_tactics.txt"); + let actual = create_output_filter_config("test_files/config/mitre_tactics.txt"); let expected: HashMap = HashMap::from([ ("attack.impact".to_string(), "Impact".to_string()), ("xxx".to_string(), "yyy".to_string()), @@ -596,11 +593,8 @@ mod tests { #[test] /// loading test to channel_abbrevations.txt fn test_load_abbrevations() { - let actual = - create_output_filter_config("test_files/config/channel_abbreviations.txt"); - let actual2 = create_output_filter_config( - "test_files/config/channel_abbreviations.txt", - ); + let actual = create_output_filter_config("test_files/config/channel_abbreviations.txt"); + let actual2 = create_output_filter_config("test_files/config/channel_abbreviations.txt"); let expected: HashMap = HashMap::from([ ("Security".to_string(), "Sec".to_string()), ("xxx".to_string(), "yyy".to_string()),