Skip to content

Commit 6fb1f37

Browse files
committed
Introduce some intermediate variables that aid readability.
1 parent 22943ee commit 6fb1f37

File tree

1 file changed

+5
-3
lines changed
  • src/librustc_data_structures/obligation_forest

1 file changed

+5
-3
lines changed

src/librustc_data_structures/obligation_forest/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,10 @@ impl<O: ForestObligation> ObligationForest<O> {
300300

301301
match self.active_cache.entry(obligation.as_predicate().clone()) {
302302
Entry::Occupied(o) => {
303+
let index = *o.get();
303304
debug!("register_obligation_at({:?}, {:?}) - duplicate of {:?}!",
304-
obligation, parent, o.get());
305-
let node = &mut self.nodes[*o.get()];
305+
obligation, parent, index);
306+
let node = &mut self.nodes[index];
306307
if let Some(parent_index) = parent {
307308
// If the node is already in `active_cache`, it has already
308309
// had its chance to be marked with a parent. So if it's
@@ -337,7 +338,8 @@ impl<O: ForestObligation> ObligationForest<O> {
337338
if already_failed {
338339
Err(())
339340
} else {
340-
v.insert(self.nodes.len());
341+
let new_index = self.nodes.len();
342+
v.insert(new_index);
341343
self.nodes.push(Node::new(parent, obligation, obligation_tree_id));
342344
Ok(())
343345
}

0 commit comments

Comments
 (0)