aboutsummaryrefslogtreecommitdiff
path: root/src/filters/player.rs
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-04-29 15:49:24 +0200
committerDaniel <kingdread@gmx.de>2020-04-29 15:49:24 +0200
commit16019515dffe4dd790adc72ed8a8ece8fc54c260 (patch)
treefaea65e5fbbd174d86ff42db4289a1cb7dfd54c9 /src/filters/player.rs
parent283a56b3a77cd3eb57afe02874cf463b244503da (diff)
downloadraidgrep-16019515dffe4dd790adc72ed8a8ece8fc54c260.tar.gz
raidgrep-16019515dffe4dd790adc72ed8a8ece8fc54c260.tar.bz2
raidgrep-16019515dffe4dd790adc72ed8a8ece8fc54c260.zip
update evtclib to 0.2.0
Diffstat (limited to 'src/filters/player.rs')
-rw-r--r--src/filters/player.rs17
1 files changed, 7 insertions, 10 deletions
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()