diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-05-02 15:00:24 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-05-02 15:00:24 +0200 |
commit | e54b6aa3a1dc6cbdcde07c075b2d7bd18cc2e729 (patch) | |
tree | 556a5f247ca0448b14f4fbf49d459b626096c429 /src/raw | |
parent | 078b55e8ae17bf781371c4bd6bf40da2ba3db336 (diff) | |
download | evtclib-e54b6aa3a1dc6cbdcde07c075b2d7bd18cc2e729.tar.gz evtclib-e54b6aa3a1dc6cbdcde07c075b2d7bd18cc2e729.tar.bz2 evtclib-e54b6aa3a1dc6cbdcde07c075b2d7bd18cc2e729.zip |
implement From<Evtc> 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.
Diffstat (limited to 'src/raw')
-rw-r--r-- | src/raw/parser.rs | 11 |
1 files changed, 11 insertions, 0 deletions
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<Skill>, } +impl From<Evtc> 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 { |