fixed cargo clippy errors
This commit is contained in:
@@ -228,7 +228,8 @@ fn emit_csv<W: std::io::Write>(
|
|||||||
let mut timestamps: Vec<i64> = Vec::new();
|
let mut timestamps: Vec<i64> = Vec::new();
|
||||||
let mut plus_header = true;
|
let mut plus_header = true;
|
||||||
let mut detected_record_idset: HashSet<String> = HashSet::new();
|
let mut detected_record_idset: HashSet<String> = HashSet::new();
|
||||||
for (time, detect_infos) in messages.iter() {
|
let detect_union = messages.iter();
|
||||||
|
for (time, detect_infos) in detect_union {
|
||||||
timestamps.push(_get_timestamp(time));
|
timestamps.push(_get_timestamp(time));
|
||||||
for detect_info in detect_infos {
|
for detect_info in detect_infos {
|
||||||
detected_record_idset.insert(format!("{}_{}", time, detect_info.eventid));
|
detected_record_idset.insert(format!("{}_{}", time, detect_info.eventid));
|
||||||
@@ -429,7 +430,7 @@ fn _get_serialized_disp_output(dispformat: Option<DisplayFormat>) -> String {
|
|||||||
|
|
||||||
/// return str position in output file
|
/// return str position in output file
|
||||||
fn _format_cellpos(colval: &str, column: ColPos) -> String {
|
fn _format_cellpos(colval: &str, column: ColPos) -> String {
|
||||||
return match column {
|
match column {
|
||||||
ColPos::First => format!("{} ", colval),
|
ColPos::First => format!("{} ", colval),
|
||||||
ColPos::Last => format!(" {}", colval),
|
ColPos::Last => format!(" {}", colval),
|
||||||
ColPos::Other => format!(" {} ", colval),
|
ColPos::Other => format!(" {} ", colval),
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ pub fn insert_pivot_keyword(event_record: &Value) {
|
|||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let mut pivots = PIVOT_KEYWORD.write().unwrap().iter_mut();
|
||||||
for (_, pivot) in PIVOT_KEYWORD.write().unwrap().iter_mut() {
|
for (_, pivot) in pivots {
|
||||||
for field in &pivot.fields {
|
for field in &pivot.fields {
|
||||||
if let Some(array_str) = configs::EVENTKEY_ALIAS.get_event_key(&String::from(field)) {
|
if let Some(array_str) = configs::EVENTKEY_ALIAS.get_event_key(&String::from(field)) {
|
||||||
let split: Vec<&str> = array_str.split('.').collect();
|
let split: Vec<&str> = array_str.split('.').collect();
|
||||||
|
|||||||
@@ -252,7 +252,8 @@ impl AlertMessage {
|
|||||||
.as_bytes(),
|
.as_bytes(),
|
||||||
)
|
)
|
||||||
.ok();
|
.ok();
|
||||||
for error_log in ERROR_LOG_STACK.lock().unwrap().iter() {
|
let error_logs = ERROR_LOG_STACK.lock().unwrap().iter();
|
||||||
|
for error_log in error_logs {
|
||||||
writeln!(error_log_writer, "{}", error_log).ok();
|
writeln!(error_log_writer, "{}", error_log).ok();
|
||||||
}
|
}
|
||||||
println!(
|
println!(
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ impl PipeElement {
|
|||||||
wildcard_regex_value.to_string()
|
wildcard_regex_value.to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
return format!("{}{}", acc, regex_value);
|
format!("{}{}", acc, regex_value)
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ fn create_recordinfos(record: &Value) -> String {
|
|||||||
let summary: Vec<String> = output
|
let summary: Vec<String> = output
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(key, value)| {
|
.map(|(key, value)| {
|
||||||
return format!("{}:{}", key, value);
|
format!("{}:{}", key, value)
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
@@ -314,7 +314,7 @@ fn _collect_recordinfo<'a>(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Event.Systemは出力しない
|
// Event.Systemは出力しない
|
||||||
if key.eq("System") && keys.get(0).unwrap_or(&"").eq(&"Event") {
|
if key.eq("System") && keys.first().unwrap_or(&"").eq(&"Event") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,11 +35,12 @@ impl Timeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn tm_stats_dsp_msg(&mut self) {
|
pub fn tm_stats_dsp_msg(&mut self) {
|
||||||
if !configs::CONFIG
|
let statics_flag = configs::CONFIG
|
||||||
.read()
|
.read()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.args
|
.args
|
||||||
.is_present("statistics")
|
.is_present("statistics");
|
||||||
|
if ! statics_flag
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -70,11 +71,12 @@ impl Timeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn tm_logon_stats_dsp_msg(&mut self) {
|
pub fn tm_logon_stats_dsp_msg(&mut self) {
|
||||||
if !configs::CONFIG
|
let logon_summary_flag = configs::CONFIG
|
||||||
.read()
|
.read()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.args
|
.args
|
||||||
.is_present("logon-summary")
|
.is_present("logon-summary");
|
||||||
|
if !logon_summary_flag
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user