Skip to content

Commit

Permalink
Derive Hash on tendermint::Time
Browse files Browse the repository at this point in the history
Now that we're backed by a data structure with unambiguously unique
values, we can make time moments hashable.
  • Loading branch information
mzabaluev committed Dec 13, 2021
1 parent 01ff277 commit 597296d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tendermint/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::error::Error;
// For memory efficiency, the inner member is `PrimitiveDateTime`, with assumed
// UTC offset. The `assume_utc` method is used to get the operational
// `OffsetDateTime` value.
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[serde(try_from = "Timestamp", into = "Timestamp")]
pub struct Time(PrimitiveDateTime);

Expand Down

0 comments on commit 597296d

Please sign in to comment.