better documentation
This commit is contained in:
parent
85a553080a
commit
36118c3299
1 changed files with 4 additions and 3 deletions
|
@ -98,13 +98,14 @@ fn main() {
|
|||
.flatten()
|
||||
.collect();
|
||||
|
||||
// Storing airport data as a list of reference counted pointers
|
||||
let mut airports: Airports = HashMap::new();
|
||||
|
||||
for record in &data {
|
||||
insert_airports_from_record(&mut airports, record);
|
||||
}
|
||||
|
||||
let _code_to_id: HashMap<String, usize> = HashMap::from_iter(
|
||||
// Index for converting airport codes to airport ids
|
||||
let code_to_id: HashMap<String, usize> = HashMap::from_iter(
|
||||
airports
|
||||
.iter()
|
||||
.map(|(id, airport)| (airport.code.clone(), *id)),
|
||||
|
@ -132,7 +133,7 @@ fn main() {
|
|||
|
||||
// Using command line arguments as input
|
||||
let args: Vec<String> = env::args().collect();
|
||||
let (origin_id, destination_id) = cmd::handle_args(args, _code_to_id);
|
||||
let (origin_id, destination_id) = cmd::handle_args(args, code_to_id);
|
||||
|
||||
println!("{:#?} {:#?}", graph[&origin_id], graph[&destination_id]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue