switch to NodePointer alias
This commit is contained in:
parent
876aa735dc
commit
3d14f3b3e1
1 changed files with 3 additions and 5 deletions
|
@ -9,20 +9,19 @@ use std::{
|
|||
cell::RefCell,
|
||||
collections::{hash_map::Entry, HashMap},
|
||||
env,
|
||||
f64::INFINITY,
|
||||
rc::Rc,
|
||||
};
|
||||
|
||||
use parse::Record;
|
||||
|
||||
type Graph = HashMap<usize, Rc<RefCell<Node>>>;
|
||||
type NodePointer = Rc<RefCell<Node>>;
|
||||
type Graph = HashMap<usize, NodePointer>;
|
||||
type Airports = HashMap<usize, Rc<airport::Airport>>;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct Node {
|
||||
origin: Rc<airport::Airport>,
|
||||
destinations: Vec<Destination>,
|
||||
source_distance: f64,
|
||||
visited: bool,
|
||||
}
|
||||
|
||||
|
@ -31,7 +30,6 @@ impl Node {
|
|||
Node {
|
||||
destinations,
|
||||
origin,
|
||||
source_distance: INFINITY,
|
||||
visited: false,
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +37,7 @@ impl Node {
|
|||
|
||||
#[derive(Clone)]
|
||||
struct Destination {
|
||||
node: Rc<RefCell<Node>>,
|
||||
node: NodePointer,
|
||||
distance: f64,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue