From: Ian Jackson Date: Tue, 11 May 2021 13:44:58 +0000 (+0100) Subject: impl Borrow for GoodItemName X-Git-Tag: otter-0.6.0~349 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d9c9f5912fe2f0ee1b535945a2cef369ed68c292;p=otter.git impl Borrow for GoodItemName Signed-off-by: Ian Jackson --- diff --git a/src/gamestate.rs b/src/gamestate.rs index f05a7e7c..85eb1fa7 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -110,6 +110,9 @@ mod item_name { impl From for String { fn from(i: GoodItemName) -> String { i.0 } } + impl Borrow for GoodItemName { + fn borrow(&self) -> &str { &self.0 } + } impl Display for GoodItemName { #[throws(fmt::Error)] fn fmt(&self, f: &mut fmt::Formatter) { f.write_str(&self.0)? }