From 2ba28aa914dcd0a79dea65a8899ef7a770bdc9c9 Mon Sep 17 00:00:00 2001 From: trivernis Date: Mon, 3 Oct 2022 18:52:23 +0200 Subject: [PATCH] Add Hash implementation for &str --- Cargo.toml | 2 +- src/value_trait.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2a51562..e251902 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = [".", "derive"] [package] name = "rusty-value" -version = "0.2.0" +version = "0.2.1" edition = "2021" license = "Apache-2.0" repository = "https://github.com/Trivernis/rusty-value" diff --git a/src/value_trait.rs b/src/value_trait.rs index 98694a5..105a85a 100644 --- a/src/value_trait.rs +++ b/src/value_trait.rs @@ -101,6 +101,12 @@ impl HashableRustyValue for String { } } +impl<'a> HashableRustyValue for &'a str { + fn into_hashable_rusty_value(self) -> HashableValue { + self.to_string().into_hashable_rusty_value() + } +} + impl HashableRustyValue for bool { #[inline] fn into_hashable_rusty_value(self) -> HashableValue {