diff options
Diffstat (limited to 'src/filters')
-rw-r--r-- | src/filters/log.rs | 2 | ||||
-rw-r--r-- | src/filters/player.rs | 17 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/filters/log.rs b/src/filters/log.rs index 8d4e0b5..6be7acc 100644 --- a/src/filters/log.rs +++ b/src/filters/log.rs @@ -10,7 +10,7 @@ use super::{ use std::collections::HashSet; use evtclib::raw::parser::PartialEvtc; -use evtclib::statistics::gamedata::Boss; +use evtclib::Boss; use chrono::{Datelike, NaiveDateTime}; use num_traits::FromPrimitive as _; diff --git a/src/filters/player.rs b/src/filters/player.rs index 4daeb22..7258bd7 100644 --- a/src/filters/player.rs +++ b/src/filters/player.rs @@ -8,8 +8,10 @@ use super::{ Filter, Inclusion, }; +use std::convert::TryFrom; + use evtclib::raw::parser::PartialEvtc; -use evtclib::{Agent, AgentName}; +use evtclib::{Agent, AgentKind}; use regex::Regex; @@ -31,7 +33,7 @@ impl Filter<PartialEvtc, LogResult> for AllPlayers { continue; } - let agent = Agent::from_raw(agent); + let agent = Agent::try_from(agent); if let Ok(agent) = agent { result = result & self.0.filter_early(&agent); } else { @@ -72,15 +74,10 @@ impl Filter<Agent, Player> for NameFilter { return Inclusion::Unknown; } - if let AgentName::Player { - ref account_name, - ref character_name, - .. - } = agent.name() - { + if let AgentKind::Player(ref player) = agent.kind() { let field = match self.0 { - SearchField::Account => account_name, - SearchField::Character => character_name, + SearchField::Account => player.account_name(), + SearchField::Character => player.character_name(), _ => unreachable!("We already checked for Guild earlier"), }; self.1.is_match(field).into() |