Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jaggededgedjustice committed Apr 7, 2023
1 parent 5632a6e commit 83fe746
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/format/strftime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,9 @@ fn test_strftime_docs() {
assert_eq!(dt.format("%%").unwrap().to_string(), "%");

// complex format specifiers
assert_eq!(dt.format(" %Y%d%m%%%%%t%H%M%S\t").to_string(), " 20010807%%\t003460\t");
assert_eq!(dt.format(" %Y%d%m%%%%%t%H%M%S\t").unwrap().to_string(), " 20010807%%\t003460\t");
assert_eq!(
dt.format(" %Y%d%m%%%%%t%H:%P:%M%S%:::z\t").to_string(),
dt.format(" %Y%d%m%%%%%t%H:%P:%M%S%:::z\t").unwrap().to_string(),
" 20010807%%\t00:am:3460+09\t"
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/naive/datetime/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn test_datetime_from_timestamp_millis() {
for (timestamp_millis, formatted) in valid_map.iter().copied() {
let naive_datetime = NaiveDateTime::from_timestamp_millis(timestamp_millis);
assert_eq!(timestamp_millis, naive_datetime.unwrap().timestamp_millis());
assert_eq!(naive_datetime.unwrap().format("%F %T%.9f").to_string(), formatted);
assert_eq!(naive_datetime.unwrap().format("%F %T%.9f").unwrap().to_string(), formatted);
}

let invalid = [i64::MAX, i64::MIN];
Expand Down Expand Up @@ -57,7 +57,7 @@ fn test_datetime_from_timestamp_micros() {
for (timestamp_micros, formatted) in valid_map.iter().copied() {
let naive_datetime = NaiveDateTime::from_timestamp_micros(timestamp_micros);
assert_eq!(timestamp_micros, naive_datetime.unwrap().timestamp_micros());
assert_eq!(naive_datetime.unwrap().format("%F %T%.9f").to_string(), formatted);
assert_eq!(naive_datetime.unwrap().format("%F %T%.9f").unwrap().to_string(), formatted);
}

let invalid = [i64::MAX, i64::MIN];
Expand Down
2 changes: 1 addition & 1 deletion tests/dateutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn verify_against_date_command_format_local(path: &'static str, dt: NaiveDateTim
let ldt = Local
.from_local_datetime(&date.and_hms_opt(dt.hour(), dt.minute(), dt.second()).unwrap())
.unwrap();
let formated_date = format!("{}\n", ldt.format(required_format));
let formated_date = format!("{}\n", ldt.format(required_format).unwrap());
assert_eq!(date_command_str, formated_date);
}

Expand Down

0 comments on commit 83fe746

Please sign in to comment.