From 16019515dffe4dd790adc72ed8a8ece8fc54c260 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 29 Apr 2020 15:49:24 +0200 Subject: update evtclib to 0.2.0 --- src/filters/log.rs | 2 +- src/filters/player.rs | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src/filters') 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 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 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() -- cgit v1.2.3