Remove unnecessary code from timeline_event_info and rename files for… (#470)

* Remove unnecessary code from timeline_event_info and rename files for issue462

* Remove unnecessary code #462
This commit is contained in:
garigariganzy
2022-03-30 09:46:18 +09:00
committed by GitHub
parent fa86a9a027
commit 7861174a93
4 changed files with 505 additions and 519 deletions
+4 -16
View File
@@ -39,7 +39,7 @@ impl ConfigReader {
pub fn new() -> Self {
ConfigReader {
args: build_app(),
event_timeline_config: load_eventcode_info("config/timeline_event_info.txt"),
event_timeline_config: load_eventcode_info("config/statistics_event_info.txt"),
target_eventids: load_target_ids("config/target_eventids.txt"),
}
}
@@ -298,8 +298,6 @@ fn load_eventkey_alias(path: &str) -> EventKeyAliasConfig {
#[derive(Debug, Clone)]
pub struct EventInfo {
pub evttitle: String,
pub detectflg: String,
pub comment: String,
}
impl Default for EventInfo {
@@ -311,13 +309,7 @@ impl Default for EventInfo {
impl EventInfo {
pub fn new() -> EventInfo {
let evttitle = "Unknown".to_string();
let detectflg = "".to_string();
let comment = "".to_string();
EventInfo {
evttitle,
detectflg,
comment,
}
EventInfo { evttitle }
}
}
#[derive(Debug, Clone)]
@@ -355,21 +347,17 @@ fn load_eventcode_info(path: &str) -> EventInfoConfig {
return config;
}
// timeline_event_infoが読み込めなかったらエラーで終了とする。
// statistics_event_infoが読み込めなかったらエラーで終了とする。
read_result.unwrap().into_iter().for_each(|line| {
if line.len() != 4 {
if line.len() != 2 {
return;
}
let empty = &"".to_string();
let eventcode = line.get(0).unwrap_or(empty);
let event_title = line.get(1).unwrap_or(empty);
let detect_flg = line.get(2).unwrap_or(empty);
let comment = line.get(3).unwrap_or(empty);
infodata = EventInfo {
evttitle: event_title.to_string(),
detectflg: detect_flg.to_string(),
comment: comment.to_string(),
};
config
.eventinfo