Skip to content

Commit

Permalink
Smaller cleanups: impl more std traits, use the Into blanket impl…
Browse files Browse the repository at this point in the history
… for `UtcDateTime` (#102)
  • Loading branch information
Árpád Goretity  authored and zonyitoo committed Jul 28, 2018
1 parent 463cdc1 commit c7677f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ pub struct TimeStamp {
/// date_time: UtcDateTime,
/// }
/// ```
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Copy, Clone)]
pub struct UtcDateTime(pub DateTime<Utc>);

impl Deref for UtcDateTime {
Expand All @@ -622,9 +622,9 @@ impl DerefMut for UtcDateTime {
}
}

impl Into<DateTime<Utc>> for UtcDateTime {
fn into(self) -> DateTime<Utc> {
self.0
impl From<UtcDateTime> for DateTime<Utc> {
fn from(utc: UtcDateTime) -> Self {
utc.0
}
}

Expand Down

0 comments on commit c7677f0

Please # to comment.