Skip to content

Commit

Permalink
Rollup merge of rust-lang#45081 - tamird:fmt-cleanup, r=alexcrichton
Browse files Browse the repository at this point in the history
fmt: misc cleanup
  • Loading branch information
kennytm committed Oct 8, 2017
2 parents 48cb6af + 41b105b commit db202e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/libcore/fmt/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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()
}
}

Expand Down Expand Up @@ -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()
}
}

Expand Down Expand Up @@ -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()
}
}

Expand Down Expand Up @@ -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()
}
}
3 changes: 1 addition & 2 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down Expand Up @@ -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 }

Expand Down

0 comments on commit db202e3

Please sign in to comment.