Skip to content

Commit

Permalink
feat: aircraft parse poc
Browse files Browse the repository at this point in the history
  • Loading branch information
cathaypacific8747 committed May 30, 2024
1 parent 3a7e5a6 commit f94f9c9
Show file tree
Hide file tree
Showing 14 changed files with 952 additions and 581 deletions.
18 changes: 10 additions & 8 deletions am4-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
use am4::airport::Airports;
// use am4::airport::Airports;
use am4::aircraft::Aircrafts;
// use std::rc::Rc;
// use std::time::Instant;

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);

// println!("{:#?}", y);
// println!("{:#?}", y2);
// print their address let y: Result<Option<&Rc<Airport>>, Error>
// let x = airports.suggest("vhhh");
// println!("{:?}", x);

let x = airports.suggest("vhhh");
println!("{:?}", x);
let aircrafts = Aircrafts::from_csv("am4/data/aircrafts.csv").unwrap();
// println!("{:#?}", aircrafts);
println!("{:#?}", aircrafts.search("a388").unwrap());
println!("{:#?}", aircrafts.search("a388[sfc]").unwrap());
}
984 changes: 492 additions & 492 deletions am4/data/aircrafts.csv

Large diffs are not rendered by default.

Loading

0 comments on commit f94f9c9

Please sign in to comment.