Cargo-fmt fixes

This commit is contained in:
Morgan Phillips
2016-07-12 14:42:49 -07:00
parent c6b1388fdc
commit 180eae3bb5

View File

@@ -40,7 +40,6 @@ pub struct ControlFlowGraph {
}
impl ControlFlowGraph {
/// During initialization mappings will be generated for any existing
/// blocks within the CFG's associated function. Basic sanity checks will
/// also be performed to ensure that the blocks are well formed.
@@ -76,7 +75,7 @@ impl ControlFlowGraph {
InstructionData::Nullary { ty: _, opcode: _ } => {
terminated = true;
}
_ => ()
_ => (),
}
}
}
@@ -89,16 +88,19 @@ impl ControlFlowGraph {
self.data.insert(ebb, BTreeSet::new());
match self.data.get_mut(&ebb) {
Some(predecessors) => Ok(predecessors),
None => Err("Ebb initialization failed.")
None => Err("Ebb initialization failed."),
}
}
/// Attempts to add a predecessor for some ebb, attempting to initialize
/// any ebb which has no entry.
pub fn add_predecessor(&mut self, ebb: Ebb, predecessor: Predecessor) -> Result<(), &'static str> {
pub fn add_predecessor(&mut self,
ebb: Ebb,
predecessor: Predecessor)
-> Result<(), &'static str> {
let success = match self.data.get_mut(&ebb) {
Some(predecessors) => predecessors.insert(predecessor),
None => false
None => false,
};
if success {