Skip to content

Commit

Permalink
add gitignore and filter for stops that are in future
Browse files Browse the repository at this point in the history
  • Loading branch information
AdriDevelopsThings committed Dec 31, 2022
1 parent d4294e0 commit cc555d6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/.vscode
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iceportal_rich_presense"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
authors = ["AdriDevelopsThings"]
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ async fn main() {
let status_info = ICEPortal::fetch_status().await
.expect("Error while fetching iceportal data");
let available_stops = trip_info.trip.stops.iter()
.filter(|stop| stop.info.position_status.is_none() || stop.info.position_status == Some(PositionStatus::Future))
.map(|stop| stop.station.name.as_str()).collect::<Vec<&str>>();
let leave_station = Select::new("At which station will you leave the train?", available_stops).prompt()
.expect("Error while prompt");
Expand Down

0 comments on commit cc555d6

Please sign in to comment.