From 4b20bd1a8da30eb2ed88adb390e5cf7994779556 Mon Sep 17 00:00:00 2001 From: tison Date: Mon, 21 Oct 2024 14:15:09 +0800 Subject: [PATCH] feat: add `CustomFormat::new()` to allow construction. --- gix-date/src/time/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gix-date/src/time/mod.rs b/gix-date/src/time/mod.rs index 4d9f9974dbf..cc6d91bb859 100644 --- a/gix-date/src/time/mod.rs +++ b/gix-date/src/time/mod.rs @@ -33,6 +33,13 @@ pub enum Format { #[derive(Clone, Copy, Debug)] pub struct CustomFormat(pub(crate) &'static str); +impl CustomFormat { + /// Create a new custom format. + pub const fn new(format: &'static str) -> Self { + Self(format) + } +} + impl From for Format { fn from(custom_format: CustomFormat) -> Format { Format::Custom(custom_format)