fixed cargo clippy error

This commit is contained in:
DustInDark
2022-06-07 20:39:08 +09:00
parent c8d2ab1d4c
commit 9362e81f53
2 changed files with 5 additions and 5 deletions

View File

@@ -57,8 +57,8 @@ pub fn insert_pivot_keyword(event_record: &Value) {
} else {
return;
}
let mut pivots = PIVOT_KEYWORD.write().unwrap().clone();
for (_, pivot) in pivots.iter_mut() {
let mut pivots = PIVOT_KEYWORD.write().unwrap();
pivots.iter_mut().into_iter().for_each(|(_, pivot)| {
for field in &pivot.fields {
if let Some(array_str) = configs::EVENTKEY_ALIAS.get_event_key(&String::from(field)) {
let split: Vec<&str> = array_str.split('.').collect();
@@ -82,7 +82,7 @@ pub fn insert_pivot_keyword(event_record: &Value) {
}
}
}
}
});
}
#[cfg(test)]

View File

@@ -297,7 +297,8 @@ impl App {
if *PIVOT_KEYWORD_LIST_FLAG {
//ファイル出力の場合
if let Some(pivot_file) = configs::CONFIG.read().unwrap().args.value_of("output") {
for (key, pivot_keyword) in PIVOT_KEYWORD.read().unwrap().iter() {
let pivot_key_unions = PIVOT_KEYWORD.read().unwrap().clone();
for (key, pivot_keyword) in pivot_key_unions.iter() {
let mut f = BufWriter::new(
fs::File::create(pivot_file.to_owned() + "-" + key + ".txt").unwrap(),
);
@@ -321,7 +322,6 @@ impl App {
//output to stdout
let mut output =
"Pivot keyword results saved to the following files:\n".to_string();
let pivot_key_unions = PIVOT_KEYWORD.read().unwrap().clone();
for (key, _) in pivot_key_unions.iter() {
output += &(pivot_file.to_owned() + "-" + key + ".txt" + "\n");