Rollup merge of #45081 - tamird:fmt-cleanup, r=alexcrichton
fmt: misc cleanup
This commit is contained in:
commit
db202e34ae
2 changed files with 6 additions and 7 deletions
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use fmt::{self, FlagV1};
|
||||
use fmt;
|
||||
|
||||
struct PadAdapter<'a, 'b: 'a> {
|
||||
fmt: &'a mut fmt::Formatter<'b>,
|
||||
|
@ -140,7 +140,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
|
|||
}
|
||||
|
||||
fn is_pretty(&self) -> bool {
|
||||
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
|
||||
self.fmt.alternate()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
|
|||
}
|
||||
|
||||
fn is_pretty(&self) -> bool {
|
||||
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
|
||||
self.fmt.alternate()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
|
|||
}
|
||||
|
||||
fn is_pretty(&self) -> bool {
|
||||
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
|
||||
self.fmt.alternate()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -519,6 +519,6 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
|
|||
}
|
||||
|
||||
fn is_pretty(&self) -> bool {
|
||||
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
|
||||
self.fmt.alternate()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -322,7 +322,6 @@ impl<'a> ArgumentV1<'a> {
|
|||
|
||||
// flags available in the v1 format of format_args
|
||||
#[derive(Copy, Clone)]
|
||||
#[allow(dead_code)] // SignMinus isn't currently used
|
||||
enum FlagV1 { SignPlus, SignMinus, Alternate, SignAwareZeroPad, }
|
||||
|
||||
impl<'a> Arguments<'a> {
|
||||
|
@ -1276,7 +1275,7 @@ impl<'a> Formatter<'a> {
|
|||
write(self.buf, fmt)
|
||||
}
|
||||
|
||||
/// Flags for formatting (packed version of rt::Flag)
|
||||
/// Flags for formatting
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn flags(&self) -> u32 { self.flags }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue