Fixed Clippy Warnings (#451)

* fixed clippy warn

* fixed cargo clippy warnging

* fixed clippy warngings in clippy ver 0.1.59

* fixed clippy warnings clippy::unnecessary_to_owned
This commit is contained in:
DustInDark
2022-03-17 08:43:48 +09:00
committed by GitHub
parent 04b881cb66
commit 7c7a86f7c9
11 changed files with 65 additions and 90 deletions

View File

@@ -184,12 +184,11 @@ pub fn get_event_value<'a>(key: &str, event_value: &'a Value) -> Option<&'a Valu
Option::Some(ret)
} else {
let event_key;
if !key.contains('.') {
event_key = "Event.EventData.".to_string() + key;
let event_key = if !key.contains('.') {
"Event.EventData.".to_string() + key
} else {
event_key = key.to_string();
}
key.to_string()
};
for key in event_key.split('.') {
if !ret.is_object() {
return Option::None;
@@ -207,7 +206,7 @@ pub fn get_thread_num() -> usize {
let threadnum = &conf
.args
.value_of("thread-number")
.unwrap_or_else(|| def_thread_num_str.as_str());
.unwrap_or(def_thread_num_str.as_str());
threadnum.parse::<usize>().unwrap()
}