From 4b659bc35a0fdf0a853f80bcf836c9b9d0193c5b Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Sat, 30 Jul 2022 12:48:06 +0200 Subject: [PATCH] lib: introduce a VERSION constant, the daemon version --- src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 99155118..45215298 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,6 +54,20 @@ fn setup_panic_hook() { })); } +#[derive(Debug, Clone)] +pub struct Version { + pub major: u32, + pub minor: u32, +} + +impl fmt::Display for Version { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}.{}", self.major, self.minor) + } +} + +pub const VERSION: Version = Version { major: 0, minor: 1 }; + #[derive(Debug)] pub enum StartupError { Io(io::Error),