Skip to content

Commit

Permalink
Version 1.4.1. Added default values for optional variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
thatzok committed Sep 13, 2024
1 parent 4e12d19 commit 5b4d665
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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 = "TheBus2Komsi"
version = "1.4.0"
version = "1.4.1"
edition = "2021"
rust-version = "1.78"

Expand Down
8 changes: 4 additions & 4 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ pub struct ApiLamps {
pub traveller_light: f32,
#[serde(rename = "ButtonLight Door 1")]
pub front_door_light: f32,
#[serde(rename = "ButtonLight Door 2")]
#[serde(rename = "ButtonLight Door 2", default)]
pub second_door_light: f32,
#[serde(rename = "LED StopRequest")]
#[serde(rename = "LED StopRequest", default)]
pub led_stop_request: f32,
#[serde(rename = "ButtonLight BusStopBrake")]
#[serde(rename = "ButtonLight BusStopBrake", default)]
pub light_stopbrake: f32,
}

pub fn getapidata(ip: &String, debug:bool) -> Result<ApiVehicleType, Box<dyn std::error::Error>> {
pub fn getapidata(ip: &String, debug: bool) -> Result<ApiVehicleType, Box<dyn std::error::Error>> {
let request_url = format!("http://{}:37337/Vehicles/Current", ip);

let timeout = Duration::new(2, 0);
Expand Down

0 comments on commit 5b4d665

Please sign in to comment.