Skip to content

Commit d561984

Browse files
committed
derive traits where possible
1 parent 3073940 commit d561984

File tree

1 file changed

+2
-56
lines changed
  • src/unix/linux_like/linux

1 file changed

+2
-56
lines changed

src/unix/linux_like/linux/mod.rs

+2-56
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,9 @@ s_no_extra_traits! {
941941
pub sched_deadline: ::__u64,
942942
pub sched_period: ::__u64,
943943
}
944+
}
944945

946+
s! {
945947
// linux/ptp_clock.h
946948
pub struct ptp_sys_offset {
947949
pub n_samples: ::c_uint,
@@ -1489,62 +1491,6 @@ cfg_if! {
14891491
self.sched_period.hash(state);
14901492
}
14911493
}
1492-
1493-
impl PartialEq for ptp_sys_offset {
1494-
fn eq(&self, other: &ptp_sys_offset) -> bool {
1495-
self.n_samples == other.n_samples &&
1496-
self.rsv == other.rsv &&
1497-
self.ts[..] == other.ts[..]
1498-
}
1499-
}
1500-
impl Eq for ptp_sys_offset {}
1501-
impl ::fmt::Debug for ptp_sys_offset {
1502-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1503-
f.debug_struct("ptp_sys_offset")
1504-
.field("n_samples", &self.n_samples)
1505-
.field("rsv", &self.rsv)
1506-
.field("ts", &&self.ts[..])
1507-
.finish()
1508-
}
1509-
}
1510-
impl ::hash::Hash for ptp_sys_offset {
1511-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1512-
self.n_samples.hash(state);
1513-
self.rsv.hash(state);
1514-
self.ts[..].hash(state);
1515-
}
1516-
}
1517-
1518-
impl PartialEq for ptp_pin_desc {
1519-
fn eq(&self, other: &ptp_pin_desc) -> bool {
1520-
self.name[..] == other.name[..] &&
1521-
self.index == other.index &&
1522-
self.func == other.func &&
1523-
self.chan == other.chan &&
1524-
self.rsv == other.rsv
1525-
}
1526-
}
1527-
impl Eq for ptp_pin_desc {}
1528-
impl ::fmt::Debug for ptp_pin_desc {
1529-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1530-
f.debug_struct("ptp_pin_desc")
1531-
.field("name", &&self.name[..])
1532-
.field("index", &self.index)
1533-
.field("func", &self.func)
1534-
.field("chan", &self.chan)
1535-
.field("rsv", &self.rsv)
1536-
.finish()
1537-
}
1538-
}
1539-
impl ::hash::Hash for ptp_pin_desc {
1540-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1541-
self.name[..].hash(state);
1542-
self.index.hash(state);
1543-
self.func.hash(state);
1544-
self.chan.hash(state);
1545-
self.rsv.hash(state);
1546-
}
1547-
}
15481494
}
15491495
}
15501496

0 commit comments

Comments
 (0)