Skip to content

Commit

Permalink
feat: add CustomFormat::new() to allow construction.
Browse files Browse the repository at this point in the history
  • Loading branch information
tisonkun authored and Byron committed Oct 21, 2024
1 parent b36d7ef commit 4b20bd1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gix-date/src/time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CustomFormat> for Format {
fn from(custom_format: CustomFormat) -> Format {
Format::Custom(custom_format)
Expand Down

0 comments on commit 4b20bd1

Please sign in to comment.