Skip to content

Commit

Permalink
feat: add Default impl (derive) for time structs
Browse files Browse the repository at this point in the history
  • Loading branch information
gwen-lg committed Jul 18, 2024
1 parent f23db3f commit 8413bf2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/time/time_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::fmt;
use std::ops::Neg;

/// Define a time in milliseconds
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TimePoint(i64);

impl TimePoint {
Expand Down
2 changes: 1 addition & 1 deletion src/time/time_span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::TimePoint;
use core::fmt::{self, Debug};

/// Define a time span with a start time and an end time.
#[derive(Clone, Copy, PartialEq, Eq)]
#[derive(Clone, Copy, Default, PartialEq, Eq)]
pub struct TimeSpan {
/// Start time of the span
pub start: TimePoint,
Expand Down

0 comments on commit 8413bf2

Please sign in to comment.