diff options
author | Daniel <kingdread@gmx.de> | 2018-09-14 01:13:03 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2018-09-14 01:13:03 +0200 |
commit | 7e6c5c5811c174f89948a7996491e09f931762a5 (patch) | |
tree | 36b570495f6270bfc06492daaa923f76b90f34fc | |
parent | f2e17ccd45565596dcd791491a2969d32cc18c05 (diff) | |
download | raidgrep-7e6c5c5811c174f89948a7996491e09f931762a5.tar.gz raidgrep-7e6c5c5811c174f89948a7996491e09f931762a5.tar.bz2 raidgrep-7e6c5c5811c174f89948a7996491e09f931762a5.zip |
handle logs which do not have a boss agent
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 85018c8..9d98cc9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -232,9 +232,11 @@ fn search_log(entry: &DirEntry, opt: &Opt) -> Result<Option<LogResult>, RuntimeE /// Extract human-readable information from the given log file. fn extract_info(entry: &DirEntry, log: &Log) -> LogResult { - let boss_name = match log.boss().name() { - AgentName::Single(s) => s, - _ => "<unknown>", + let bosses = log.boss_agents(); + let boss_name = if bosses.len() == 1 { + unwrap! { AgentName::Single(s) = bosses[0].name() => { s } } + } else { + "<unknown>" }.into(); let mut players = log |