From abac13a7dd984e4190f649802a4e614dbf4d82cd Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Tue, 23 Jul 2019 00:44:20 -0700 Subject: [PATCH] Bound `Event` by `FromStr`. --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 18288f00..1b069312 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -112,6 +112,7 @@ use std::{ error::Error, fmt::{Debug, Display, Error as FmtError, Formatter, Result as FmtResult}, + str::FromStr, }; use js_int::UInt; @@ -431,7 +432,7 @@ pub enum EventType { /// A basic event. pub trait Event where - Self: Debug + Serialize, + Self: Debug + FromStr + Serialize, { /// The type of this event's `content` field. type Content: Debug + Serialize;