Rustfmt fixes

This commit is contained in:
Morgan Phillips
2016-08-29 13:17:08 -07:00
parent adde184042
commit 26cd358bd4
5 changed files with 22 additions and 5 deletions

View File

@@ -108,7 +108,11 @@ impl DominatorTree {
// TODO: we can't rely on instruction numbers to always be ordered // TODO: we can't rely on instruction numbers to always be ordered
// from lowest to highest. Given that, it will be necessary to create // from lowest to highest. Given that, it will be necessary to create
// an abolute mapping to determine the instruction order in the future. // an abolute mapping to determine the instruction order in the future.
if a.1 == NO_INST || a.1 < b.1 { a } else { b } if a.1 == NO_INST || a.1 < b.1 {
a
} else {
b
}
} }
/// Returns the immediate dominator of some ebb or None if the /// Returns the immediate dominator of some ebb or None if the

View File

@@ -42,7 +42,11 @@ impl EntityRef for Ebb {
impl Ebb { impl Ebb {
/// Create a new EBB reference from its number. This corresponds to the ebbNN representation. /// Create a new EBB reference from its number. This corresponds to the ebbNN representation.
pub fn with_number(n: u32) -> Option<Ebb> { pub fn with_number(n: u32) -> Option<Ebb> {
if n < u32::MAX { Some(Ebb(n)) } else { None } if n < u32::MAX {
Some(Ebb(n))
} else {
None
}
} }
} }

View File

@@ -60,7 +60,11 @@ impl FromStr for Imm64 {
let mut value: u64 = 0; let mut value: u64 = 0;
let mut digits = 0; let mut digits = 0;
let negative = s.starts_with('-'); let negative = s.starts_with('-');
let s2 = if negative { &s[1..] } else { s }; let s2 = if negative {
&s[1..]
} else {
s
};
if s2.starts_with("0x") { if s2.starts_with("0x") {
// Hexadecimal. // Hexadecimal.

View File

@@ -95,7 +95,10 @@ impl FromStr for Opcode {
/// `Box<AuxData>` to store the additional information out of line. /// `Box<AuxData>` to store the additional information out of line.
#[derive(Debug)] #[derive(Debug)]
pub enum InstructionData { pub enum InstructionData {
Nullary { opcode: Opcode, ty: Type }, Nullary {
opcode: Opcode,
ty: Type,
},
Unary { Unary {
opcode: Opcode, opcode: Opcode,
ty: Type, ty: Type,

View File

@@ -227,7 +227,9 @@ pub mod detail {
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
pub enum Detail { pub enum Detail {
/// A boolean setting only uses one bit, numbered from LSB. /// A boolean setting only uses one bit, numbered from LSB.
Bool { bit: u8 }, Bool {
bit: u8,
},
/// A numerical setting uses the whole byte. /// A numerical setting uses the whole byte.
Num, Num,