eventid: asref implementation

This commit is contained in:
William Casarin
2023-07-06 19:36:12 -07:00
parent 6d0aa0e09c
commit 684bc5f913

View File

@@ -83,6 +83,12 @@ impl std::str::FromStr for Event {
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone, Hash)]
pub struct EventId(String);
impl AsRef<str> for EventId {
fn as_ref(&self) -> &str {
&self.0
}
}
impl From<String> for EventId {
fn from(s: String) -> Self {
EventId(s)