Skip to content

Commit

Permalink
rename!: time::format::GIT_DEFAULT -> *::DEFAULT and *::DEFAULT
Browse files Browse the repository at this point in the history
… -> `*::GITOXIDE`.

That way we properly indicate what we are doing and don't try to somewhat
sneakily suggest that the default for git dates is something else
due to personal preference.
  • Loading branch information
Byron committed Jan 1, 2023
1 parent c65ce7e commit 41fc2bb
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 87 deletions.
135 changes: 62 additions & 73 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions git-date/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) mod function {
use crate::{
parse::{relative, Error},
time::{
format::{DEFAULT, GIT_DEFAULT, ISO8601, ISO8601_STRICT, SHORT},
format::{DEFAULT, GITOXIDE, ISO8601, ISO8601_STRICT, SHORT},
Sign,
},
Time,
Expand All @@ -41,9 +41,9 @@ pub(crate) mod function {
Time::new(val.unix_timestamp().try_into()?, val.offset().whole_seconds())
} else if let Ok(val) = OffsetDateTime::parse(input, ISO8601_STRICT) {
Time::new(val.unix_timestamp().try_into()?, val.offset().whole_seconds())
} else if let Ok(val) = OffsetDateTime::parse(input, DEFAULT) {
} else if let Ok(val) = OffsetDateTime::parse(input, GITOXIDE) {
Time::new(val.unix_timestamp().try_into()?, val.offset().whole_seconds())
} else if let Ok(val) = OffsetDateTime::parse(input, GIT_DEFAULT) {
} else if let Ok(val) = OffsetDateTime::parse(input, DEFAULT) {
Time::new(val.unix_timestamp().try_into()?, val.offset().whole_seconds())
} else if let Ok(val) = u32::from_str(input) {
// Format::Unix
Expand Down
Loading

0 comments on commit 41fc2bb

Please sign in to comment.