From 35ac54da07a3ee07e00d552dbc2ad24176296cfd Mon Sep 17 00:00:00 2001 From: patoche Date: Tue, 28 Jul 2020 17:50:33 +0200 Subject: [PATCH] Bump for breaking change --- Cargo.toml | 4 ++-- gtfs2netexfr/Cargo.toml | 2 +- gtfs2ntfs/Cargo.toml | 2 +- ntfs2gtfs/Cargo.toml | 2 +- ntfs2netexfr/Cargo.toml | 2 +- ntfs2ntfs/Cargo.toml | 2 +- restrict-validity-period/Cargo.toml | 2 +- src/objects.rs | 15 ++++++++++----- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 397fa5e69..da610bd2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Kisio Digital ", "Guillaume Pinot "] name = "transit_model" -version = "0.27.0" +version = "0.28.0" license = "AGPL-3.0-only" description = "Transit data management" repository = "https://github.com/CanalTP/transit_model" @@ -39,7 +39,7 @@ xmllint = ["proj"] [dependencies] chrono = "0.4" -chrono-tz = { version = "0.4", features = ["serde"] } +chrono-tz = { version = "0.5", features = ["serde"] } csv = "1" derivative = "2" failure = "0.1" diff --git a/gtfs2netexfr/Cargo.toml b/gtfs2netexfr/Cargo.toml index f368bfd2c..b206bf8ac 100644 --- a/gtfs2netexfr/Cargo.toml +++ b/gtfs2netexfr/Cargo.toml @@ -22,4 +22,4 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.27", path = "../", features = ["proj"] } +transit_model = { version = "0.28", path = "../", features = ["proj"] } diff --git a/gtfs2ntfs/Cargo.toml b/gtfs2ntfs/Cargo.toml index b23a4df1f..bb9ebde8a 100644 --- a/gtfs2ntfs/Cargo.toml +++ b/gtfs2ntfs/Cargo.toml @@ -22,4 +22,4 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.27", path = "../" } +transit_model = { version = "0.28", path = "../" } diff --git a/ntfs2gtfs/Cargo.toml b/ntfs2gtfs/Cargo.toml index 73a3a19bc..592bb32a0 100644 --- a/ntfs2gtfs/Cargo.toml +++ b/ntfs2gtfs/Cargo.toml @@ -22,4 +22,4 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.27", path = "../" } +transit_model = { version = "0.28", path = "../" } diff --git a/ntfs2netexfr/Cargo.toml b/ntfs2netexfr/Cargo.toml index 8835a6f83..da298b4eb 100644 --- a/ntfs2netexfr/Cargo.toml +++ b/ntfs2netexfr/Cargo.toml @@ -22,4 +22,4 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.27", path = "../", features = ["proj"] } +transit_model = { version = "0.28", path = "../", features = ["proj"] } diff --git a/ntfs2ntfs/Cargo.toml b/ntfs2ntfs/Cargo.toml index 3e21236b7..87da1954f 100644 --- a/ntfs2ntfs/Cargo.toml +++ b/ntfs2ntfs/Cargo.toml @@ -22,4 +22,4 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.27", path = "../" } +transit_model = { version = "0.28", path = "../" } diff --git a/restrict-validity-period/Cargo.toml b/restrict-validity-period/Cargo.toml index 7f6efe77a..281fb7826 100644 --- a/restrict-validity-period/Cargo.toml +++ b/restrict-validity-period/Cargo.toml @@ -21,4 +21,4 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.27", path = "../" } +transit_model = { version = "0.28", path = "../" } diff --git a/src/objects.rs b/src/objects.rs index a36728ddd..cf464b1a6 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -345,7 +345,7 @@ pub struct Network { pub url: Option, #[serde(skip)] pub codes: KeysValues, - // #[derivative(Default(value = "\"Europe/Paris\".parse().ok()"))] + #[derivative(Default(value = "\"Europe/Paris\".parse().ok()"))] #[serde(rename = "network_timezone")] pub timezone: Option, #[serde(rename = "network_lang")] @@ -1812,6 +1812,14 @@ impl AddPrefix for GridRelCalendarLine { } } +/// Wrapper around [`Tz`] that implements [`Display`]. +/// +/// [`Display`] is implemented for [`Tz`] +/// but not released yet. Wait for [chrono-tz] version > 0.5.2 +/// +/// [`Display`]: https://doc.rust-lang.org/std/fmt/trait.Display.html +/// [`Tz`]: https://docs.rs/chrono-tz/0.5.2/chrono_tz/enum.Tz.html +/// [chrono-tz]: https://crates.io/crates/chrono-tz #[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)] pub struct TzExt(pub Tz); @@ -1825,10 +1833,7 @@ impl std::fmt::Display for TzExt { impl FromStr for TzExt { type Err = String; fn from_str(s: &str) -> std::result::Result { - match Tz::from_str(s) { - Ok(timezone) => Ok(TzExt(timezone)), - Err(err) => Err(err), - } + Tz::from_str(s).map(TzExt) } }