diff options
author | Daniel <kingdread@gmx.de> | 2020-05-12 14:03:57 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-05-12 14:04:54 +0200 |
commit | 331dbac270273889111a3cd4bb73d16eeaf5ebde (patch) | |
tree | f9bff785f8bb0faa9476e153a63013f12031cfcc /src/playerclass.rs | |
parent | 371186e872df3518bb5a2894f487ec02a42c771a (diff) | |
download | raidgrep-331dbac270273889111a3cd4bb73d16eeaf5ebde.tar.gz raidgrep-331dbac270273889111a3cd4bb73d16eeaf5ebde.tar.bz2 raidgrep-331dbac270273889111a3cd4bb73d16eeaf5ebde.zip |
use Display implementations from evtclib
Diffstat (limited to 'src/playerclass.rs')
-rw-r--r-- | src/playerclass.rs | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/src/playerclass.rs b/src/playerclass.rs index 247e8b1..31a49aa 100644 --- a/src/playerclass.rs +++ b/src/playerclass.rs @@ -67,43 +67,10 @@ impl From<&evtclib::Player> for PlayerClass { impl fmt::Display for PlayerClass { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use EliteSpec::*; - use Profession::*; - - let name = match *self { - PlayerClass::EliteSpec(elite) => match elite { - Dragonhunter => "Dragonhunter", - Firebrand => "Firebrand", - Berserker => "Berserker", - Spellbreaker => "Spellbreaker", - Herald => "Herald", - Renegade => "Renegade", - Scrapper => "Scrapper", - Holosmith => "Holosmith", - Druid => "Druid", - Soulbeast => "Soulbeast", - Daredevil => "Daredevil", - Deadeye => "Deadeye", - Tempest => "Tempest", - Weaver => "Weaver", - Chronomancer => "Chronomancer", - Mirage => "Mirage", - Reaper => "Reaper", - Scourge => "Scourge", - }, - PlayerClass::Profession(prof) => match prof { - Guardian => "Guardian", - Warrior => "Warrior", - Revenant => "Revenant", - Engineer => "Engineer", - Ranger => "Ranger", - Thief => "Thief", - Elementalist => "Elementalist", - Mesmer => "Mesmer", - Necromancer => "Necromancer", - }, - }; - write!(f, "{}", name) + match *self { + PlayerClass::EliteSpec(elite) => elite.fmt(f), + PlayerClass::Profession(prof) => prof.fmt(f), + } } } |