Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pinky: use UTC if offset can't be determined #6414

Merged
merged 1 commit into from
May 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/uu/pinky/src/platform/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

fn idle_string(when: i64) -> String {
thread_local! {
static NOW: time::OffsetDateTime = time::OffsetDateTime::now_local().unwrap();
static NOW: time::OffsetDateTime = time::OffsetDateTime::now_local().unwrap_or_else(|_| time::OffsetDateTime::now_utc());

Check warning on line 118 in src/uu/pinky/src/platform/unix.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/pinky/src/platform/unix.rs#L118

Added line #L118 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the coverage isn't happy, i guess there is nothing we can do

}
NOW.with(|n| {
let duration = n.unix_timestamp() - when;
Expand Down
Loading