about summary refs log tree commit diff
path: root/src/librustc_data_structures/graph/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_data_structures/graph/test.rs')
-rw-r--r--src/librustc_data_structures/graph/test.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_data_structures/graph/test.rs b/src/librustc_data_structures/graph/test.rs
index 48b654726b8..b72d011c99b 100644
--- a/src/librustc_data_structures/graph/test.rs
+++ b/src/librustc_data_structures/graph/test.rs
@@ -33,12 +33,12 @@ impl TestGraph {
         for &(source, target) in edges {
             graph.num_nodes = max(graph.num_nodes, source + 1);
             graph.num_nodes = max(graph.num_nodes, target + 1);
-            graph.successors.entry(source).or_insert(vec![]).push(target);
-            graph.predecessors.entry(target).or_insert(vec![]).push(source);
+            graph.successors.entry(source).or_default().push(target);
+            graph.predecessors.entry(target).or_default().push(source);
         }
         for node in 0..graph.num_nodes {
-            graph.successors.entry(node).or_insert(vec![]);
-            graph.predecessors.entry(node).or_insert(vec![]);
+            graph.successors.entry(node).or_default();
+            graph.predecessors.entry(node).or_default();
         }
         graph
     }