Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
svaningelgem committed Oct 12, 2023
1 parent 4cdd76b commit 53f1fb0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/polars-time/src/chunkedarray/utf8/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl TryFromWithUnit<Pattern> for DatetimeInfer<Int64Type> {
fn try_from_with_unit(value: Pattern, time_unit: Option<TimeUnit>) -> PolarsResult<Self> {
let time_unit = time_unit.expect("time_unit must be provided for datetime");

let transform = match (time_unit , value) {
let transform = match (time_unit, value) {
(TimeUnit::Milliseconds, Pattern::DatetimeYMDZ) => transform_tzaware_datetime_ms,
(TimeUnit::Milliseconds, _) => transform_datetime_ms,
(TimeUnit::Microseconds, Pattern::DatetimeYMDZ) => transform_tzaware_datetime_us,
Expand All @@ -241,9 +241,13 @@ impl TryFromWithUnit<Pattern> for DatetimeInfer<Int64Type> {
(TimeUnit::Nanoseconds, _) => transform_datetime_ns,
};
let (pattern, patterns) = match value {
(Pattern::DatetimeDMY | Pattern::DateDMY) => (Pattern::DatetimeDMY, patterns::DATETIME_D_M_Y),
(Pattern::DatetimeYMD | Pattern::DateYMD) => (Pattern::DatetimeYMD, patterns::DATETIME_Y_M_D),
(Pattern::DatetimeYMDZ) => (Pattern::DatetimeYMDZ, patterns::DATETIME_Y_M_D_Z),
Pattern::DatetimeDMY | Pattern::DateDMY => {
(Pattern::DatetimeDMY, patterns::DATETIME_D_M_Y)
},
Pattern::DatetimeYMD | Pattern::DateYMD => {
(Pattern::DatetimeYMD, patterns::DATETIME_Y_M_D)
},
Pattern::DatetimeYMDZ => (Pattern::DatetimeYMDZ, patterns::DATETIME_Y_M_D_Z),
};

Ok(DatetimeInfer {
Expand Down

0 comments on commit 53f1fb0

Please sign in to comment.