Skip to content

Commit c7677f0

Browse files
Árpád Goretity zonyitoo
authored andcommitted
Smaller cleanups: impl more std traits, use the Into blanket impl for UtcDateTime (#102)
1 parent 463cdc1 commit c7677f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bson.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ pub struct TimeStamp {
605605
/// date_time: UtcDateTime,
606606
/// }
607607
/// ```
608-
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
608+
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Copy, Clone)]
609609
pub struct UtcDateTime(pub DateTime<Utc>);
610610

611611
impl Deref for UtcDateTime {
@@ -622,9 +622,9 @@ impl DerefMut for UtcDateTime {
622622
}
623623
}
624624

625-
impl Into<DateTime<Utc>> for UtcDateTime {
626-
fn into(self) -> DateTime<Utc> {
627-
self.0
625+
impl From<UtcDateTime> for DateTime<Utc> {
626+
fn from(utc: UtcDateTime) -> Self {
627+
utc.0
628628
}
629629
}
630630

0 commit comments

Comments
 (0)