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

remove chrono dependency from Time::now() #50

Merged
merged 2 commits into from
Dec 13, 2023
Merged

remove chrono dependency from Time::now() #50

merged 2 commits into from
Dec 13, 2023

Conversation

jankeu
Copy link
Contributor

@jankeu jankeu commented Dec 12, 2023

Removes unnecessary chrono dependency from Time::now.

Self::millis(Duration::from(std_dur).as_millis())
} else {
let std_dur = SystemTime::UNIX_EPOCH.duration_since(input).unwrap();
Self::millis(-Duration::from(std_dur).as_millis())
Copy link
Contributor Author

@jankeu jankeu Dec 12, 2023

Choose a reason for hiding this comment

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

std::time::Duration is u64, whereas our Duration and Time is i64, so we need to distinguish cases here.

@jankeu jankeu marked this pull request as ready for review December 12, 2023 13:36
@jankeu jankeu merged commit e64e73e into main Dec 13, 2023
@jankeu jankeu deleted the hack/fix-time-now branch December 13, 2023 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants