Skip to content

Commit

Permalink
Rollup merge of #37288 - srinivasreddy:snapshot_map, r=eddyb
Browse files Browse the repository at this point in the history
run rustfmt on snapshot_map
  • Loading branch information
GuillaumeGomez authored Oct 19, 2016
2 parents 655ecd8 + 4e89811 commit dd3a014
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/librustc_data_structures/snapshot_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct SnapshotMap<K, V>
}

pub struct Snapshot {
len: usize
len: usize,
}

enum UndoLog<K, V> {
Expand All @@ -39,7 +39,7 @@ impl<K, V> SnapshotMap<K, V>
pub fn new() -> Self {
SnapshotMap {
map: FnvHashMap(),
undo_log: vec![]
undo_log: vec![],
}
}

Expand Down Expand Up @@ -68,9 +68,7 @@ impl<K, V> SnapshotMap<K, V>
}
true
}
None => {
false
}
None => false,
}
}

Expand All @@ -88,7 +86,7 @@ impl<K, V> SnapshotMap<K, V>
assert!(snapshot.len < self.undo_log.len());
assert!(match self.undo_log[snapshot.len] {
UndoLog::OpenSnapshot => true,
_ => false
_ => false,
});
}

Expand All @@ -110,7 +108,7 @@ impl<K, V> SnapshotMap<K, V>
panic!("cannot rollback an uncommitted snapshot");
}

UndoLog::CommittedSnapshot => { }
UndoLog::CommittedSnapshot => {}

UndoLog::Inserted(key) => {
self.map.remove(&key);
Expand All @@ -123,7 +121,10 @@ impl<K, V> SnapshotMap<K, V>
}

let v = self.undo_log.pop().unwrap();
assert!(match v { UndoLog::OpenSnapshot => true, _ => false });
assert!(match v {
UndoLog::OpenSnapshot => true,
_ => false,
});
assert!(self.undo_log.len() == snapshot.len);
}
}
Expand Down

0 comments on commit dd3a014

Please sign in to comment.