chiark / gitweb /
impl Borrow<str> for GoodItemName
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 11 May 2021 13:44:58 +0000 (14:44 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 11 May 2021 13:44:58 +0000 (14:44 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/gamestate.rs

index f05a7e7c6294cc4fa249871befdb1dfbbc149554..85eb1fa73fdc25a7b4c5742b604597fd6160287e 100644 (file)
@@ -110,6 +110,9 @@ mod item_name {
   impl From<GoodItemName> for String {
     fn from(i: GoodItemName) -> String { i.0 }
   }
+  impl Borrow<str> 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)? }