aboutsummaryrefslogtreecommitdiff
path: root/src/app/message.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/message.rs')
-rw-r--r--src/app/message.rs12
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
20impl<T> From<T> for Message
21where
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
20pub struct Message { 32pub struct Message {
21 msg: String, 33 msg: String,
22 kind: MessageKind, 34 kind: MessageKind,