Skip to content

Commit

Permalink
Merge pull request #845 from CanalTP/upgrade_packages
Browse files Browse the repository at this point in the history
[tech] Upgrade packages
  • Loading branch information
David Quintanel authored Mar 14, 2022
2 parents 85fc96a + bceb008 commit 46ee5e4
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Kisio Digital <team.coretools@kisio.com>", "Guillaume Pinot <texitoi@texitoi.eu>"]
name = "transit_model"
version = "0.48.1"
version = "0.49.0"
license = "AGPL-3.0-only"
description = "Transit data management"
repository = "https://github.com/CanalTP/transit_model"
Expand Down Expand Up @@ -43,7 +43,7 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock"
chrono-tz = { version = "0.6", features = ["serde"] }
csv = "1"
derivative = "2"
geo = "0.18"
geo = "0.19"
iso4217 = "0.3"
lazy_static = "1"
md5 = "0.7"
Expand All @@ -54,7 +54,7 @@ minidom_ext = "1"
minidom_writer = "1"
num-traits = "0.2"
pretty_assertions = "1"
proj = { version = "0.24", optional = true } # libproj version used by 'proj' crate must be propagated to CI and makefile
proj = { version = "0.25", optional = true } # libproj version used by 'proj' crate must be propagated to CI and makefile
quick-xml = "0.22"
relational_types = "2"
rust_decimal = "1"
Expand All @@ -66,7 +66,7 @@ thiserror = "1"
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
typed_index_collection = "2"
walkdir = "2"
wkt = "0.9"
wkt = "0.10"
zip = { version = "0.5", default-features = false, features = ["deflate"] }
git-version = "0.3"

Expand Down
4 changes: 2 additions & 2 deletions gtfs2netexfr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock"
structopt = "0.3"
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
tracing-log = "0.1"
tracing-subscriber = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
transit_model = { path = "../", features = ["proj"] }
lazy_static = "1"

[dev-dependencies]
assert_cmd = "1"
assert_cmd = "2"
tempfile = "3"
4 changes: 2 additions & 2 deletions gtfs2ntfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock"
structopt = "0.3"
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
tracing-log = "0.1"
tracing-subscriber = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
transit_model = { path = "../" }
lazy_static = "1"

[dev-dependencies]
assert_cmd = "1"
assert_cmd = "2"
tempfile = "3"
4 changes: 2 additions & 2 deletions ntfs2gtfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock"
structopt = "0.3"
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
tracing-log = "0.1"
tracing-subscriber = "0.2"
tracing-subscriber = "0.3"
transit_model = { path = "../" }
lazy_static = "1"

[dev-dependencies]
assert_cmd = "1"
assert_cmd = "2"
tempfile = "3"
4 changes: 2 additions & 2 deletions ntfs2netexfr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock"
structopt = "0.3"
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
tracing-log = "0.1"
tracing-subscriber = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
transit_model = { path = "../", features = ["proj"] }
lazy_static = "1"

[dev-dependencies]
assert_cmd = "1"
assert_cmd = "2"
tempfile = "3"
4 changes: 2 additions & 2 deletions ntfs2ntfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock"
structopt = "0.3"
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
tracing-log = "0.1"
tracing-subscriber = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
transit_model = { path = "../" }
lazy_static = "1"

[dev-dependencies]
assert_cmd = "1"
assert_cmd = "2"
tempfile = "3"
2 changes: 1 addition & 1 deletion restrict-validity-period/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock"
structopt = "0.3"
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
tracing-log = "0.1"
tracing-subscriber = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
transit_model = { path = "../" }
2 changes: 1 addition & 1 deletion src/netex_france/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl<'a> Exporter<'a> {
let from = "+proj=longlat +datum=WGS84 +no_defs"; // https://epsg.io/4326
let to = "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"; // https://epsg.io/2154
Proj::new_known_crs(from, to, None)
.ok_or_else(|| anyhow!("Proj cannot build a converter from '{}' to '{}'", from, to))
.map_err(|_| anyhow!("Proj cannot build a converter from '{}' to '{}'", from, to))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ntfs/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ where
|v| v != 0,
);

let precision = stop_time.precision.or_else(|| {
let precision = stop_time.precision.or({
if datetime_estimated {
Some(StopTimePrecision::Estimated)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/ntfs/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ fn build_price_v1(id: &str, ticket: &Ticket, price: &TicketPrice) -> Result<Pric
.round_dp(0)
.to_u32()
.ok_or_else(|| anyhow!("Cannot convert price {:?} into a u32", cents_price))?;
let comment = ticket.comment.clone().unwrap_or_else(String::new);
let comment = ticket.comment.clone().unwrap_or_default();
let price_v1 = PriceV1 {
id: id.to_string(),
start_date: price.ticket_validity_start,
Expand Down
2 changes: 1 addition & 1 deletion src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ impl FromStr for Time {
};
let hours: u32 = hours.parse()?;
let minutes: u32 = minutes.parse()?;
let last_second_number = seconds.find('.').unwrap_or_else(|| seconds.len());
let last_second_number = seconds.find('.').unwrap_or(seconds.len());
let seconds: u32 = seconds[..last_second_number].parse()?;
if minutes > 59 || seconds > 59 {
return Err(TimeError::WrongValue);
Expand Down
7 changes: 4 additions & 3 deletions src/serde_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ where
{
use serde::Deserialize;
let option = Option::<String>::deserialize(de)?;
Ok(option.map(|s| s.replace("/", "")))
Ok(option.map(|s| s.replace('/', "")))
}

/// deserialize type
Expand All @@ -150,6 +150,7 @@ where
D: serde::Deserializer<'de>,
{
use serde::Deserialize;
use std::str::FromStr;
let s = String::deserialize(deserializer)?;
let wkt = wkt::Wkt::from_str(&s).map_err(serde::de::Error::custom)?;
use std::convert::TryInto;
Expand Down Expand Up @@ -266,7 +267,7 @@ where
use serde::ser::Error;
let currency_code = iso4217::alpha3(currency_code)
.ok_or_else(|| S::Error::custom("The String is not a valid currency code (ISO-4217)"))?;
serializer.serialize_str(&currency_code.alpha3.to_string())
serializer.serialize_str(currency_code.alpha3)
}

/// serialize geometry to wkt
Expand All @@ -275,7 +276,7 @@ where
S: serde::Serializer,
{
let wkt = geometry.to_wkt();
serializer.serialize_str(&format!("{}", wkt.items[0]))
serializer.serialize_str(&format!("{}", wkt.item))
}

/// deserialyse optional String
Expand Down
2 changes: 1 addition & 1 deletion src/vptranslator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ mod tests {
fn empty_vp() {
let res = translate(&get_dates_from_bitset(
Date::from_ymd(2012, 7, 16),
&"0000000".to_string(),
"0000000",
));

assert_eq!(0b000_0000, get_week_from_weekday(res.operating_days));
Expand Down

0 comments on commit 46ee5e4

Please sign in to comment.