mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 13:05:18 +03:00
Rollup merge of #45081 - tamird:fmt-cleanup, r=alexcrichton
fmt: misc cleanup
This commit is contained in:
@@ -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 @@ pub fn finish(&mut self) -> fmt::Result {
|
||||
}
|
||||
|
||||
fn is_pretty(&self) -> bool {
|
||||
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
|
||||
self.fmt.alternate()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ pub fn finish(&mut self) -> fmt::Result {
|
||||
}
|
||||
|
||||
fn is_pretty(&self) -> bool {
|
||||
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
|
||||
self.fmt.alternate()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ pub fn finish(&mut self) {
|
||||
}
|
||||
|
||||
fn is_pretty(&self) -> bool {
|
||||
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
|
||||
self.fmt.alternate()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,6 +519,6 @@ pub fn finish(&mut self) -> fmt::Result {
|
||||
}
|
||||
|
||||
fn is_pretty(&self) -> bool {
|
||||
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
|
||||
self.fmt.alternate()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +322,6 @@ fn as_usize(&self) -> Option<usize> {
|
||||
|
||||
// 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 @@ pub fn write_fmt(&mut self, fmt: Arguments) -> Result {
|
||||
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 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user