From e54b6aa3a1dc6cbdcde07c075b2d7bd18cc2e729 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sat, 2 May 2020 15:00:24 +0200 Subject: implement From for PartialEvtc We can always do this conversion, because we can just throw away the events field. The other way around is not possible, as we need a file to parse the events from. --- src/raw/parser.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/raw/parser.rs b/src/raw/parser.rs index dcc7f2f..00ca85e 100644 --- a/src/raw/parser.rs +++ b/src/raw/parser.rs @@ -122,6 +122,17 @@ pub struct PartialEvtc { pub skills: Vec, } +impl From for PartialEvtc { + fn from(evtc: Evtc) -> Self { + Self { + header: evtc.header, + skill_count: evtc.skill_count, + agents: evtc.agents, + skills: evtc.skills, + } + } +} + /// Any error that can occur during parsing. #[derive(Error, Debug)] pub enum ParseError { -- cgit v1.2.3