summaryrefslogtreecommitdiff
path: root/rust/graph/graph.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/graph/graph.rs')
-rw-r--r--rust/graph/graph.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/rust/graph/graph.rs b/rust/graph/graph.rs
index 648c131..30ffc35 100644
--- a/rust/graph/graph.rs
+++ b/rust/graph/graph.rs
@@ -8,9 +8,10 @@ struct Node {
label: i32,
neighbors: Vec<Rc<RefCell<Node>>>,
}
+type RefNode = Rc<RefCell<Node>>;
-fn make_graph() -> Vec<Rc<RefCell<Node>>> {
- let mut nodes : Vec<Rc<RefCell<Node>>> = Vec::new();
+fn make_graph() -> Vec<RefNode> {
+ let mut nodes : Vec<RefNode> = vec!();
{
let mut make_node = |label: i32| {
let node = Rc::new(RefCell::new(Node {