提交 db202e34 编写于 作者: K kennytm 提交者: GitHub

Rollup merge of #45081 - tamird:fmt-cleanup, r=alexcrichton

fmt: misc cleanup
......@@ -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 }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册