From 999ea8f0bf4473230d173f09ccfc1a2b45e7600d Mon Sep 17 00:00:00 2001 From: Nathan F Yospe Date: Mon, 26 Feb 2024 20:00:24 -0500 Subject: [PATCH] StaticVersion can be Debug --- src/version.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/version.rs b/src/version.rs index 14ea8c7..19dd5e2 100644 --- a/src/version.rs +++ b/src/version.rs @@ -1,4 +1,5 @@ use anyhow::anyhow; +use core::fmt::Debug; use displaydoc::Display; #[derive(Clone, Copy, Debug, Display, PartialEq, Hash, Eq)] @@ -33,3 +34,17 @@ impl Version { } pub struct StaticVersion; + +impl StaticVersion { + pub const MAJOR: u16 = MAJOR; + pub const MINOR: u16 = MINOR; +} + +impl Debug for StaticVersion { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("StaticVersion") + .field("MAJOR", &Self::MAJOR) + .field("MINOR", &Self::MINOR) + .finish() + } +}