From 070735edbf26f3c94347b3d1058c3f59df9c71ee Mon Sep 17 00:00:00 2001 From: jake Date: Fri, 10 Dec 2021 13:15:33 -0700 Subject: [PATCH] ItemDetail::tool --- src/entity/item/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/entity/item/mod.rs b/src/entity/item/mod.rs index 5c320b6..611c579 100644 --- a/src/entity/item/mod.rs +++ b/src/entity/item/mod.rs @@ -162,6 +162,13 @@ impl ItemDetail { _ => None, } } + + pub fn tool(&self) -> Option<&tool::Tool> { + match self { + ItemDetail::Tool(tool) => Some(tool), + _ => None, + } + } } #[derive(Clone, Debug)]