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

Added Ord and Hash as derived traits for tokio::time::Instant #2239

Merged
merged 1 commit into from
Feb 17, 2020

Conversation

tsidea
Copy link
Contributor

@tsidea tsidea commented Feb 13, 2020

The added derived traits mirror the traits of std::time::Instant. As
tokio::time::Instant is just a wrapper around std::time::Instant, it
should also derive all the traits std::time::Instant derives.

Motivation

tokio::time::Instant is just a wrapper around std::time::Instant, as such it should
behave just like std::time::Instant. That should include what kind of
traits it derives.

Solution

Just added the same derived traits as std::time::Instant

The added derived traits mirror the traits of std::time::Instant. As
tokio::time::Instant is just a wrapper around std::time::Instant, it
should also derive all the traits std::time::Instant derives.
@katyo
Copy link

katyo commented Feb 15, 2020

I also agree that this is pretty useful traits which currently doesn't implemented for Instant.
So when I need get min/max instant I must convert it to std and back, which I would like to avoid.

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Thanks!

@LucioFranco LucioFranco merged commit 41576e6 into tokio-rs:master Feb 17, 2020
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.

None yet

3 participants