diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2019-02-23 16:52:52 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2019-02-23 16:52:52 +0100 |
commit | 1b3cb7522118d711d43ca78d0c5d7e71a5afbf46 (patch) | |
tree | ef4b945aec8b2b17d269898a7c8eded0f82a6788 /src/main.rs | |
parent | 5fb4a94d60382cd14a5a00ba3d3245a79d17ecd2 (diff) | |
download | oslobike-1b3cb7522118d711d43ca78d0c5d7e71a5afbf46.tar.gz oslobike-1b3cb7522118d711d43ca78d0c5d7e71a5afbf46.tar.bz2 oslobike-1b3cb7522118d711d43ca78d0c5d7e71a5afbf46.zip |
Deserialize stations json data into native rust struct.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 3e378d1..733af84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,5 +22,10 @@ use oslobike; fn main() { let api_key = dotenv::var("OSLOBIKE_APIKEY").expect("No API key defined!"); let api = oslobike::Api::new(api_key); - println!("{}", api.stations()); + for station in api.stations() { + println!("{:>4} {}: {}", + station.id, + station.title, + station.number_of_locks); + } } |