-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: aircraft hashmap, tests, better error handling
- Loading branch information
1 parent
f94f9c9
commit e6896ad
Showing
9 changed files
with
373 additions
and
219 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
// use am4::airport::Airports; | ||
use am4::aircraft::Aircrafts; | ||
// use am4::aircraft::Aircrafts; | ||
use am4::airport::Airports; | ||
// use std::rc::Rc; | ||
|
||
fn main() { | ||
// NOTE: directory is CWD, not the location of the executable. | ||
// let airports = Airports::from_csv("am4/data/airports.csv").unwrap(); | ||
let airports = Airports::from_csv("am4/data/airports.csv").unwrap(); | ||
// println!("{:#?}", airports); | ||
|
||
// let a1 = airports.search("vhhh"); | ||
// let a2 = airports.search("iata:hkg"); | ||
// println!("{:?}", Rc::ptr_eq(a1.unwrap(), a2.unwrap())); | ||
// println!("{:#?} {:#?}", y, y2); | ||
let a1 = airports.search("iata:hkgA"); | ||
let suggestions = airports.suggest("iata:hkgA"); | ||
|
||
println!("{:#?}", suggestions) | ||
|
||
// let x = airports.suggest("vhhh"); | ||
// println!("{:?}", x); | ||
|
||
let aircrafts = Aircrafts::from_csv("am4/data/aircrafts.csv").unwrap(); | ||
// let aircrafts = Aircrafts::from_csv("am4/data/aircrafts.csv").unwrap(); | ||
// println!("{:#?}", aircrafts); | ||
println!("{:#?}", aircrafts.search("a388").unwrap()); | ||
println!("{:#?}", aircrafts.search("a388[sfc]").unwrap()); | ||
// println!("{:#?}", aircrafts.by_id.len()); | ||
// println!("{:#?}", aircrafts.search("a388[s]").unwrap()); | ||
// println!("{:#?}", aircrafts.search_variants("a388").unwrap()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.