From 04420da334ed4f4f30e527a60b78a82c51988bcc Mon Sep 17 00:00:00 2001 From: Pavel Perestoronin Date: Sun, 16 Apr 2023 23:05:41 +0200 Subject: [PATCH] New: `impl TryInto for BattleResultsDat` --- src/models/battle_results_dat.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/models/battle_results_dat.rs b/src/models/battle_results_dat.rs index f48181a..d6c5cbe 100644 --- a/src/models/battle_results_dat.rs +++ b/src/models/battle_results_dat.rs @@ -30,3 +30,11 @@ impl BattleResultsDat { BattleResults::decode(self.1.as_ref()).map_err(Error::DecodeFailed) } } + +impl TryInto for BattleResultsDat { + type Error = Error; + + fn try_into(self) -> Result { + self.decode_battle_results() + } +}