diff options
Diffstat (limited to 'src/app/message.rs')
-rw-r--r-- | src/app/message.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/app/message.rs b/src/app/message.rs index 34d3293..65f0a5c 100644 --- a/src/app/message.rs +++ b/src/app/message.rs | |||
@@ -17,6 +17,18 @@ impl From<MessageKind> for Color { | |||
17 | } | 17 | } |
18 | } | 18 | } |
19 | 19 | ||
20 | impl<T> From<T> for Message | ||
21 | where | ||
22 | T: AsRef<str>, | ||
23 | { | ||
24 | fn from(item: T) -> Self { | ||
25 | return Message { | ||
26 | msg: item.as_ref().to_string(), | ||
27 | kind: MessageKind::Info, | ||
28 | }; | ||
29 | } | ||
30 | } | ||
31 | |||
20 | pub struct Message { | 32 | pub struct Message { |
21 | msg: String, | 33 | msg: String, |
22 | kind: MessageKind, | 34 | kind: MessageKind, |