Skip to content

Commit

Permalink
Document the Time::from_utc helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabaluev committed Dec 7, 2021
1 parent d87e926 commit f5e6244
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tendermint/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ impl From<Time> for Timestamp {
}

impl Time {
// Internal helper to produce a `Time` value validated with regard to
// the date range allowed in protobuf timestamps.
// The source `OffsetDateTime` value must have the zero UTC offset.
fn from_utc(t: OffsetDateTime) -> Result<Self, Error> {
debug_assert_eq!(t.offset(), offset!(UTC));
match t.year() {
Expand Down

0 comments on commit f5e6244

Please sign in to comment.