refactoring

This commit is contained in:
ichiichi11
2020-11-22 11:18:21 +09:00
parent da5f4119fb
commit 129db6f76c
2 changed files with 1 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ use crate::detections::rule;
use crate::detections::rule::RuleNode; use crate::detections::rule::RuleNode;
use crate::yaml::ParseYaml; use crate::yaml::ParseYaml;
use chrono::{DateTime, FixedOffset, ParseError, ParseResult, TimeZone, Utc}; use chrono::{DateTime, FixedOffset, TimeZone, Utc};
use evtx::EvtxParser; use evtx::EvtxParser;
use serde_json::{Error, Value}; use serde_json::{Error, Value};

View File

@@ -268,16 +268,6 @@ impl LeafSelectionNode {
fn get_matchers(&self) -> Vec<Box<dyn LeafMatcher>> { fn get_matchers(&self) -> Vec<Box<dyn LeafMatcher>> {
return vec![Box::new(RegexMatcher::new())]; return vec![Box::new(RegexMatcher::new())];
} }
// LeafMatcherを取得する。
fn get_matcher(&self) -> Option<Box<dyn LeafMatcher>> {
let matchers = self.get_matchers();
let mut match_key_list = self.key_list.clone();
match_key_list.remove(0);
return matchers
.into_iter()
.find(|matcher| matcher.is_target_key(&match_key_list));
}
} }
impl SelectionNode for LeafSelectionNode { impl SelectionNode for LeafSelectionNode {