Skip to content

Commit 83120be

Browse files
authored
Merge pull request #4074 from tgross35/struct-formatter
[0.2] Eliminate uses of `struct_formatter`
2 parents ac9b6c4 + 8d68ec6 commit 83120be

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

src/unix/aix/powerpc64.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,14 @@ cfg_if! {
374374
}
375375
impl Eq for fileops_t {}
376376
impl ::fmt::Debug for fileops_t {
377-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
378-
let mut struct_formatter = f.debug_struct("fileops_t");
379-
struct_formatter.field("fo_rw", &self.fo_rw);
380-
struct_formatter.field("fo_ioctl", &self.fo_ioctl);
381-
struct_formatter.field("fo_select", &self.fo_select);
382-
struct_formatter.field("fo_close", &self.fo_close);
383-
struct_formatter.field("fo_fstat", &self.fo_fstat);
384-
struct_formatter.finish()
377+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
378+
f.debug_struct("fileops_t")
379+
.field("fo_rw", &self.fo_rw)
380+
.field("fo_ioctl", &self.fo_ioctl)
381+
.field("fo_select", &self.fo_select)
382+
.field("fo_close", &self.fo_close)
383+
.field("fo_fstat", &self.fo_fstat)
384+
.finish()
385385
}
386386
}
387387
impl ::hash::Hash for fileops_t {

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,17 +1720,14 @@ cfg_if! {
17201720
}
17211721
impl Eq for xucred {}
17221722
impl ::fmt::Debug for xucred {
1723-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1724-
let mut struct_formatter = f.debug_struct("xucred");
1725-
struct_formatter.field("cr_version", &self.cr_version);
1726-
struct_formatter.field("cr_uid", &self.cr_uid);
1727-
struct_formatter.field("cr_ngroups", &self.cr_ngroups);
1728-
struct_formatter.field("cr_groups", &self.cr_groups);
1729-
struct_formatter.field(
1730-
"cr_pid__c_anonymous_union",
1731-
&self.cr_pid__c_anonymous_union
1732-
);
1733-
struct_formatter.finish()
1723+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
1724+
f.debug_struct("xucred")
1725+
.field("cr_version", &self.cr_version)
1726+
.field("cr_uid", &self.cr_uid)
1727+
.field("cr_ngroups", &self.cr_ngroups)
1728+
.field("cr_groups", &self.cr_groups)
1729+
.field("cr_pid__c_anonymous_union", &self.cr_pid__c_anonymous_union)
1730+
.finish()
17341731
}
17351732
}
17361733
impl ::hash::Hash for xucred {

0 commit comments

Comments
 (0)