fixed clippy error
This commit is contained in:
@@ -57,7 +57,7 @@ impl Detection {
|
|||||||
// ルールファイルをパースします。
|
// ルールファイルをパースします。
|
||||||
pub fn parse_rule_files(
|
pub fn parse_rule_files(
|
||||||
level: String,
|
level: String,
|
||||||
rulespath: &PathBuf,
|
rulespath: &Path,
|
||||||
exclude_ids: &filter::RuleExclude,
|
exclude_ids: &filter::RuleExclude,
|
||||||
) -> Vec<RuleNode> {
|
) -> Vec<RuleNode> {
|
||||||
// ルールファイルのパースを実行
|
// ルールファイルのパースを実行
|
||||||
@@ -409,7 +409,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_parse_rule_files() {
|
fn test_parse_rule_files() {
|
||||||
let level = "informational";
|
let level = "informational";
|
||||||
let opt_rule_path = Some("./test_files/rules/level_yaml");
|
let opt_rule_path = Path::new("./test_files/rules/level_yaml");
|
||||||
let cole =
|
let cole =
|
||||||
Detection::parse_rule_files(level.to_owned(), opt_rule_path, &filter::exclude_ids());
|
Detection::parse_rule_files(level.to_owned(), opt_rule_path, &filter::exclude_ids());
|
||||||
assert_eq!(5, cole.len());
|
assert_eq!(5, cole.len());
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ pub fn get_event_value<'a>(key: &str, event_value: &'a Value) -> Option<&'a Valu
|
|||||||
|
|
||||||
pub fn get_thread_num() -> usize {
|
pub fn get_thread_num() -> usize {
|
||||||
let conf = configs::CONFIG.read().unwrap();
|
let conf = configs::CONFIG.read().unwrap();
|
||||||
conf.args.thread_number.unwrap_or(num_cpus::get())
|
conf.args.thread_number.unwrap_or_else(num_cpus::get())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_tokio_runtime() -> Runtime {
|
pub fn create_tokio_runtime() -> Runtime {
|
||||||
|
|||||||
Reference in New Issue
Block a user