Skip to content

Commit 19dcf91

Browse files
committed
fmt: DRY
1 parent 45907f5 commit 19dcf91

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libcore/fmt/builders.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use fmt::{self, FlagV1};
11+
use fmt;
1212

1313
struct PadAdapter<'a, 'b: 'a> {
1414
fmt: &'a mut fmt::Formatter<'b>,
@@ -140,7 +140,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
140140
}
141141

142142
fn is_pretty(&self) -> bool {
143-
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
143+
self.fmt.alternate()
144144
}
145145
}
146146

@@ -233,7 +233,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
233233
}
234234

235235
fn is_pretty(&self) -> bool {
236-
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
236+
self.fmt.alternate()
237237
}
238238
}
239239

@@ -277,7 +277,7 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
277277
}
278278

279279
fn is_pretty(&self) -> bool {
280-
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
280+
self.fmt.alternate()
281281
}
282282
}
283283

@@ -519,6 +519,6 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
519519
}
520520

521521
fn is_pretty(&self) -> bool {
522-
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
522+
self.fmt.alternate()
523523
}
524524
}

0 commit comments

Comments
 (0)