Skip to content

Commit

Permalink
✨ Fixes (#32, #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeon256 committed Feb 3, 2024
1 parent 7bf6de6 commit 4ea07ca
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 99 deletions.
12 changes: 0 additions & 12 deletions src/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ pub mod bus_arrival {
#[cfg(feature = "fastfloat")]
use crate::utils::de::from_str_fast_float;

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BusArrivalv2";

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct RawArrivalBusService {
Expand Down Expand Up @@ -162,9 +159,6 @@ pub mod bus_services {
use crate::utils::regex::BUS_FREQ_RE;
use serde::{Deserialize, Deserializer, Serialize};

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BusServices";

/// Both min and max are in terms of minutes
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct BusFreq {
Expand Down Expand Up @@ -307,9 +301,6 @@ pub mod bus_routes {
use crate::utils::de::from_str;
use crate::utils::serde_date::str_time_option::{de_str_time_opt_br, ser_str_time_opt};

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BusRoutes";

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct BusRouteRaw {
Expand Down Expand Up @@ -423,9 +414,6 @@ pub mod bus_stops {

use crate::utils::de::from_str;

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BusStops";

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct BusStopRaw {
Expand Down
3 changes: 2 additions & 1 deletion src/bus_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize};
/// TTS -> Tower Transit Singapore
///
/// GAS -> Go Ahead Singapore
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum Operator {
#[serde(rename = "SBST")]
Sbst,
Expand All @@ -28,6 +28,7 @@ pub enum Operator {
#[serde(rename = "GAS")]
Gas,

#[default]
#[serde(other)]
Unknown,
}
Expand Down
27 changes: 4 additions & 23 deletions src/crowd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,7 @@ pub mod crowd_density {
OffsetDateTime,
};

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL_CROWD_DENSITY_RT: &str =
"http://datamall2.mytransport.sg/ltaodataservice/PCDRealTime";

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL_CROWD_FORECAST: &str =
"http://datamall2.mytransport.sg/ltaodataservice/PCDForecast";

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
pub enum CrowdLevel {
#[serde(rename = "l")]
Low,
Expand All @@ -35,6 +27,7 @@ pub mod crowd_density {
#[serde(rename = "m")]
Moderate,

#[default]
#[serde(other)]
Na,
}
Expand Down Expand Up @@ -142,22 +135,9 @@ pub mod crowd_density {
pub mod passenger_vol {
use serde::{Deserialize, Serialize};

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL_BY_BUS_STOPS: &str = "http://datamall2.mytransport.sg/ltaodataservice/PV/Bus";

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL_BY_OD_BUS_STOPS: &str =
"http://datamall2.mytransport.sg/ltaodataservice/PV/ODBus";

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL_BY_TRAIN: &str = "http://datamall2.mytransport.sg/ltaodataservice/PV/Train";

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL_BY_OD_TRAIN: &str = "http://datamall2.mytransport.sg/ltaodataservice/PV/ODTrain";

pub const FORMAT: &str = "%Y%m";

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
pub enum VolType {
/// Returns tap in and tap out passenger volume by weekdays and
/// weekends for individual bus stop
Expand All @@ -175,6 +155,7 @@ pub mod passenger_vol {
/// weekends for individual train station
OdTrain,

#[default]
#[serde(other)]
Unknown,
}
Expand Down
8 changes: 7 additions & 1 deletion src/geo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub mod prelude {
}

pub mod geospatial_whole_island {
use std::default;

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, nightly)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test-fastfloat (ubuntu-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test (windows-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test-fastfloat (ubuntu-latest, nightly)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / check (ubuntu-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test (windows-latest, nightly)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test-fastfloat (windows-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / check (ubuntu-latest, nightly)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test (macOS-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test-fastfloat (windows-latest, nightly)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / check (windows-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test (macOS-latest, nightly)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test-fastfloat (macOS-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / check (windows-latest, nightly)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / test-fastfloat (macOS-latest, nightly)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / check (macOS-latest, stable)

unused import: `std::default`

Check warning on line 8 in src/geo.rs

View workflow job for this annotation

GitHub Actions / check (macOS-latest, nightly)

unused import: `std::default`

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
Expand All @@ -18,7 +20,7 @@ pub mod geospatial_whole_island {
pub link: String,
}

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)]
pub enum GeospatialLayerId {
ArrowMarking,
Bollard,
Expand Down Expand Up @@ -59,6 +61,10 @@ pub mod geospatial_whole_island {
#[serde(alias = "VehicularBridge_Flyover_Underpass")]
VehicularBridgeOrFlyoverOrUnderpass,
WordMarking,

#[default]
#[serde(other)]
Unknown
}

impl From<GeospatialWholeIslandRawResp> for Vec<String> {
Expand Down
12 changes: 4 additions & 8 deletions src/taxi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ pub mod taxi_avail {
use crate::utils::Coordinates;
use serde::{Deserialize, Serialize};

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/Taxi-Availability";

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct InternalCoordinates {
/// Original data already float
Expand Down Expand Up @@ -53,10 +50,7 @@ pub mod taxi_stands {
use crate::utils::de::from_str_to_bool;
use serde::{Deserialize, Serialize};

#[deprecated(since = "0.5.0", note = "Will be removed in future versions")]
pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/TaxiStands";

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)]
pub enum TaxiStandOwner {
#[serde(rename = "LTA")]
Lta,
Expand All @@ -66,18 +60,20 @@ pub mod taxi_stands {

Private,

#[default]
#[serde(other)]
Unknown,
}

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)]
pub enum TaxiStandType {
/// Allow taxis to queue in the taxi bays and wait for passengers
Stand,

/// Allow taxis to perform immediate pick up and drop off of passengers
Stop,

#[default]
#[serde(other)]
Unknown,
}
Expand Down
Loading

0 comments on commit 4ea07ca

Please sign in to comment.