From 370a25e5a0cbb95e2aa1cec55305b22aeaf99aa0 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Tue, 12 Dec 2023 14:14:30 +0000 Subject: initial refactor --- src/notification.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/notification.rs (limited to 'src/notification.rs') diff --git a/src/notification.rs b/src/notification.rs new file mode 100644 index 0000000..2283761 --- /dev/null +++ b/src/notification.rs @@ -0,0 +1,20 @@ +pub enum Kind { + Info, + Warning, + Error, +} + +impl std::fmt::Display for Kind { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Kind::Info => f.write_str("info"), + Kind::Warning => f.write_str("warning"), + Kind::Error => f.write_str("error"), + } + } +} + +pub struct Notification { + pub kind: Kind, + pub message: String, +} -- cgit