From 41576e6c48c38e0d8418997defb7413484a5c5c5 Mon Sep 17 00:00:00 2001 From: Tudor Sidea Date: Mon, 17 Feb 2020 18:18:19 +0200 Subject: [PATCH] Added Ord and Hash as derived traits for tokio::time::Instant (#2239) 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. --- tokio/src/time/instant.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/time/instant.rs b/tokio/src/time/instant.rs index ebe991d08..f2cb4bc97 100644 --- a/tokio/src/time/instant.rs +++ b/tokio/src/time/instant.rs @@ -6,7 +6,7 @@ use std::time::Duration; /// A measurement of the system clock, useful for talking to /// external entities like the file system or other processes. -#[derive(Clone, Copy, Eq, PartialEq, PartialOrd)] +#[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash)] pub struct Instant { std: std::time::Instant, }