changed crate from hashbrown to std::collections due to be merged
hashbrown in std::collections #629
This commit is contained in:
@@ -476,7 +476,7 @@ pub fn load_pivot_keywords(path: &str) {
|
||||
.write()
|
||||
.unwrap()
|
||||
.entry(map[0].to_string())
|
||||
.or_insert(PivotKeyword::new());
|
||||
.or_insert_with(PivotKeyword::new);
|
||||
|
||||
PIVOT_KEYWORD
|
||||
.write()
|
||||
|
||||
@@ -5,7 +5,7 @@ use self::selectionnodes::{
|
||||
AndSelectionNode, NotSelectionNode, OrSelectionNode, RefSelectionNode, SelectionNode,
|
||||
};
|
||||
use super::selectionnodes;
|
||||
use hashbrown::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
lazy_static! {
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::detections::message::QUIET_ERRORS_FLAG;
|
||||
use crate::detections::rule::AggResult;
|
||||
use crate::detections::rule::RuleNode;
|
||||
use chrono::{DateTime, TimeZone, Utc};
|
||||
use hashbrown::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use serde_json::Value;
|
||||
use std::num::ParseIntError;
|
||||
use std::path::Path;
|
||||
@@ -311,10 +311,9 @@ impl CountStrategy for FieldStrategy {
|
||||
}
|
||||
|
||||
let value = &datas[idx as usize].field_record_value;
|
||||
let key_val = self.value_2_cnt.get_key_value_mut(value);
|
||||
let key_val = self.value_2_cnt.get_mut(value);
|
||||
if let Some(kv) = key_val {
|
||||
let (_, val) = kv;
|
||||
*val += 1;
|
||||
*kv += 1;
|
||||
} else {
|
||||
self.value_2_cnt.insert(value.to_string(), 1);
|
||||
}
|
||||
@@ -326,12 +325,12 @@ impl CountStrategy for FieldStrategy {
|
||||
}
|
||||
|
||||
let record_value = &datas[idx as usize].field_record_value;
|
||||
let key_val = self.value_2_cnt.get_key_value_mut(record_value);
|
||||
let key_val = self.value_2_cnt.get_mut(record_value);
|
||||
if key_val.is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
let val: &mut i64 = key_val.unwrap().1;
|
||||
let val: &mut i64 = key_val.unwrap();
|
||||
if val <= &mut 1 {
|
||||
// 0になる場合はキー自体削除する
|
||||
self.value_2_cnt.remove(record_value);
|
||||
|
||||
@@ -2,7 +2,7 @@ extern crate regex;
|
||||
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
use hashbrown::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::{fmt::Debug, sync::Arc, vec};
|
||||
|
||||
use yaml_rust::Yaml;
|
||||
|
||||
@@ -9,7 +9,7 @@ extern crate static_vcruntime;
|
||||
use bytesize::ByteSize;
|
||||
use chrono::{DateTime, Datelike, Local};
|
||||
use evtx::{EvtxParser, ParserSettings};
|
||||
use hashbrown::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use hayabusa::detections::configs::CURRENT_EXE_PATH;
|
||||
use hayabusa::detections::configs::{load_pivot_keywords, TargetEventTime, TARGET_EXTENSIONS};
|
||||
use hayabusa::detections::detection::{self, EvtxRecordInfo};
|
||||
|
||||
Reference in New Issue
Block a user