Skip to content

Commit ed27272

Browse files
committed
derive traits where possible
1 parent 6d7e27d commit ed27272

File tree

1 file changed

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

1 file changed

+5
-56
lines changed

src/unix/linux_like/linux/mod.rs

+5-56
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,9 @@ s_no_extra_traits! {
12331233
pub sched_deadline: ::__u64,
12341234
pub sched_period: ::__u64,
12351235
}
1236+
}
12361237

1238+
<<<<<<< HEAD
12371239
#[allow(missing_debug_implementations)]
12381240
pub union tpacket_req_u {
12391241
pub req: ::tpacket_req,
@@ -1252,6 +1254,9 @@ s_no_extra_traits! {
12521254
pub hdr: ::tpacket_bd_header_u,
12531255
}
12541256

1257+
=======
1258+
s! {
1259+
>>>>>>> db8ba27ec (derive traits where possible)
12551260
// linux/ptp_clock.h
12561261
pub struct ptp_sys_offset {
12571262
pub n_samples: ::c_uint,
@@ -1845,62 +1850,6 @@ cfg_if! {
18451850
.finish()
18461851
}
18471852
}
1848-
1849-
impl PartialEq for ptp_sys_offset {
1850-
fn eq(&self, other: &ptp_sys_offset) -> bool {
1851-
self.n_samples == other.n_samples &&
1852-
self.rsv == other.rsv &&
1853-
self.ts[..] == other.ts[..]
1854-
}
1855-
}
1856-
impl Eq for ptp_sys_offset {}
1857-
impl ::fmt::Debug for ptp_sys_offset {
1858-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1859-
f.debug_struct("ptp_sys_offset")
1860-
.field("n_samples", &self.n_samples)
1861-
.field("rsv", &self.rsv)
1862-
.field("ts", &&self.ts[..])
1863-
.finish()
1864-
}
1865-
}
1866-
impl ::hash::Hash for ptp_sys_offset {
1867-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1868-
self.n_samples.hash(state);
1869-
self.rsv.hash(state);
1870-
self.ts[..].hash(state);
1871-
}
1872-
}
1873-
1874-
impl PartialEq for ptp_pin_desc {
1875-
fn eq(&self, other: &ptp_pin_desc) -> bool {
1876-
self.name[..] == other.name[..] &&
1877-
self.index == other.index &&
1878-
self.func == other.func &&
1879-
self.chan == other.chan &&
1880-
self.rsv == other.rsv
1881-
}
1882-
}
1883-
impl Eq for ptp_pin_desc {}
1884-
impl ::fmt::Debug for ptp_pin_desc {
1885-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1886-
f.debug_struct("ptp_pin_desc")
1887-
.field("name", &&self.name[..])
1888-
.field("index", &self.index)
1889-
.field("func", &self.func)
1890-
.field("chan", &self.chan)
1891-
.field("rsv", &self.rsv)
1892-
.finish()
1893-
}
1894-
}
1895-
impl ::hash::Hash for ptp_pin_desc {
1896-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1897-
self.name[..].hash(state);
1898-
self.index.hash(state);
1899-
self.func.hash(state);
1900-
self.chan.hash(state);
1901-
self.rsv.hash(state);
1902-
}
1903-
}
19041853
}
19051854
}
19061855

0 commit comments

Comments
 (0)