Skip to content

Commit

Permalink
Bump for breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
patochectp authored and David Quintanel committed Aug 7, 2020
1 parent 33f4ab0 commit 35ac54d
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Kisio Digital <[email protected]>", "Guillaume Pinot <[email protected]>"]
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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gtfs2netexfr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion gtfs2ntfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../" }
2 changes: 1 addition & 1 deletion ntfs2gtfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../" }
2 changes: 1 addition & 1 deletion ntfs2netexfr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion ntfs2ntfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../" }
2 changes: 1 addition & 1 deletion restrict-validity-period/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../" }
15 changes: 10 additions & 5 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ pub struct Network {
pub url: Option<String>,
#[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<TzExt>,
#[serde(rename = "network_lang")]
Expand Down Expand Up @@ -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);

Expand All @@ -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<Self, Self::Err> {
match Tz::from_str(s) {
Ok(timezone) => Ok(TzExt(timezone)),
Err(err) => Err(err),
}
Tz::from_str(s).map(TzExt)
}
}

Expand Down

0 comments on commit 35ac54d

Please sign in to comment.