Skip to content

Commit c3d04fa

Browse files
committed
Allow construct CustomFormat outside the crate
Signed-off-by: tison <wander4096@gmail.com>
1 parent b36d7ef commit c3d04fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gix-date/src/time/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ pub enum Format {
3333
#[derive(Clone, Copy, Debug)]
3434
pub struct CustomFormat(pub(crate) &'static str);
3535

36+
impl CustomFormat {
37+
/// Create a new custom format.
38+
pub const fn new(format: &'static str) -> Self {
39+
Self(format)
40+
}
41+
}
42+
3643
impl From<CustomFormat> for Format {
3744
fn from(custom_format: CustomFormat) -> Format {
3845
Format::Custom(custom_format)

0 commit comments

Comments
 (0)