Skip to content

Commit

Permalink
Merge pull request #858 from hove-io/tech/release-0.60.0
Browse files Browse the repository at this point in the history
[tech] fix clippy warnings
  • Loading branch information
datanel authored Aug 18, 2022
2 parents 052dffd + d81a988 commit 277488a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Hove <[email protected]>", "Guillaume Pinot <[email protected]>"]
name = "transit_model"
version = "0.51.0"
version = "0.51.1"
license = "AGPL-3.0-only"
description = "Transit data management"
repository = "https://github.com/hove-io/transit_model"
Expand Down
2 changes: 1 addition & 1 deletion model-builder/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub struct VehicleJourneyBuilder<'a> {
vj_idx: Idx<VehicleJourney>,
}

impl<'a> ModelBuilder {
impl ModelBuilder {
/// Add a new VehicleJourney to the model
///
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/calendars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct CalendarDate {
}

/// Structure to serialize/deserialize the file calendar.txt
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct Calendar {
/// Identifiers of the Service
#[serde(rename = "service_id")]
Expand Down
4 changes: 2 additions & 2 deletions src/ntfs/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ mod tests {
#[test]
fn ntfs_stop_times_precision() {
test_in_tmp_dir(|path| {
let _ = generate_minimal_ntfs(path);
generate_minimal_ntfs(path);
let collections = make_collection(path);

assert_eq!(
Expand Down Expand Up @@ -860,7 +860,7 @@ mod tests {
#[test]
fn company_object_codes() {
test_in_tmp_dir(|path| {
let _ = generate_minimal_ntfs(path);
generate_minimal_ntfs(path);
let object_codes_content = "object_type,object_id,object_system,object_code\n\
company,company_1,source,source_code";
create_file_with_content(path, "object_codes.txt", object_codes_content);
Expand Down
38 changes: 19 additions & 19 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ macro_rules! impl_comment_links {
};
}

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct Contributor {
#[serde(rename = "contributor_id")]
pub id: String,
Expand Down Expand Up @@ -179,7 +179,7 @@ impl Default for Contributor {
impl_with_id!(Contributor);
impl_id!(Contributor);

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub enum DatasetType {
#[serde(rename = "0")]
Theorical,
Expand Down Expand Up @@ -210,7 +210,7 @@ impl Default for ValidityPeriod {
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct Dataset {
#[serde(rename = "dataset_id")]
pub id: String,
Expand Down Expand Up @@ -292,7 +292,7 @@ impl WithId for Dataset {
}
}

#[derive(Derivative, Serialize, Deserialize, Debug, PartialEq)]
#[derive(Derivative, Serialize, Deserialize, Debug, Eq, PartialEq)]
#[derivative(Default)]
pub struct CommercialMode {
#[derivative(Default(value = "\"default_commercial_mode\".into()"))]
Expand Down Expand Up @@ -348,7 +348,7 @@ impl Eq for PhysicalMode {}

impl_with_id!(PhysicalMode);

#[derive(Derivative, Serialize, Deserialize, Debug, PartialEq, Clone)]
#[derive(Derivative, Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
#[derivative(Default)]
pub struct Network {
#[derivative(Default(value = "\"default_network\".into()"))]
Expand Down Expand Up @@ -456,7 +456,7 @@ impl<'de> ::serde::Deserialize<'de> for Rgb {
Rgb::from_str(&color_hex).map_err(Error::custom)
}
}
#[derive(Derivative, Serialize, Deserialize, Debug, PartialEq, Clone)]
#[derive(Derivative, Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
#[derivative(Default)]
pub struct Line {
#[serde(rename = "line_id")]
Expand Down Expand Up @@ -527,7 +527,7 @@ impl GetObjectType for Line {
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Derivative, Clone)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Derivative, Clone)]
#[derivative(Default)]
pub struct Route {
#[serde(rename = "route_id")]
Expand Down Expand Up @@ -577,7 +577,7 @@ impl GetObjectType for Route {
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
pub struct VehicleJourney {
#[serde(rename = "trip_id")]
pub id: String,
Expand Down Expand Up @@ -1110,7 +1110,7 @@ impl GetObjectType for StopArea {
ObjectType::StopArea
}
}
#[derive(Derivative, Debug, PartialEq, Clone)]
#[derive(Derivative, Debug, Eq, PartialEq, Clone)]
#[derivative(Default)]
pub enum StopType {
#[derivative(Default)]
Expand Down Expand Up @@ -1297,15 +1297,15 @@ impl_id!(Level);

pub type Date = chrono::NaiveDate;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
pub enum ExceptionType {
#[serde(rename = "1")]
Add,
#[serde(rename = "2")]
Remove,
}

#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Clone)]
#[derive(Serialize, Deserialize, Default, Debug, Eq, PartialEq, Clone)]
pub struct Calendar {
pub id: String,
#[serde(skip)]
Expand Down Expand Up @@ -1342,7 +1342,7 @@ impl WithId for Calendar {
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct Company {
#[serde(rename = "company_id")]
pub id: String,
Expand Down Expand Up @@ -1391,15 +1391,15 @@ impl_with_id!(Company);

#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CommentType {
#[derivative(Default)]
Information,
OnDemandTransport,
}

#[derive(Default, Serialize, Deserialize, Debug, PartialEq)]
#[derive(Default, Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct Comment {
#[serde(rename = "comment_id")]
pub id: String,
Expand Down Expand Up @@ -1518,7 +1518,7 @@ impl Hash for Transfer {

impl Eq for Transfer {}

#[derive(Serialize, Deserialize, Debug, Derivative, PartialEq, Clone)]
#[derive(Serialize, Deserialize, Debug, Derivative, Eq, PartialEq, Clone)]
#[derivative(Default)]
pub enum TransportType {
#[derivative(Default)]
Expand All @@ -1530,7 +1530,7 @@ pub enum TransportType {
RegularAndSchool,
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Default, Clone)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Default, Clone)]
pub struct TripProperty {
#[serde(rename = "trip_property_id")]
pub id: String,
Expand Down Expand Up @@ -1682,7 +1682,7 @@ impl AddPrefix for FareV1 {
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct Ticket {
#[serde(rename = "ticket_id")]
pub id: String,
Expand Down Expand Up @@ -1734,7 +1734,7 @@ impl AddPrefix for TicketPrice {
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct TicketUse {
#[serde(rename = "ticket_use_id")]
pub id: String,
Expand Down Expand Up @@ -1884,7 +1884,7 @@ impl AddPrefix for GridRelCalendarLine {
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Clone, Default)]
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Default)]
pub struct Address {
#[serde(rename = "address_id")]
pub id: String,
Expand Down
6 changes: 3 additions & 3 deletions src/validity_period.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ mod tests {
mod set_validity_period {
use super::super::*;
use crate::objects::{Dataset, Date, ValidityPeriod};
use chrono::naive::{MAX_DATE, MIN_DATE};
use chrono::NaiveDate;
use pretty_assertions::assert_eq;

#[test]
Expand All @@ -86,8 +86,8 @@ mod tests {
let mut dataset = Dataset {
id: String::from("dataset_id"),
contributor_id: String::from("contributor_id"),
start_date: MAX_DATE,
end_date: MIN_DATE,
start_date: NaiveDate::MAX,
end_date: NaiveDate::MIN,
..Default::default()
};
let service_validity_period = ValidityPeriod {
Expand Down
2 changes: 1 addition & 1 deletion src/vptranslator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::collections::BTreeSet;
use std::vec::Vec;

///Indicates whether service is available on the date specified.
#[derive(Debug, PartialEq)]
#[derive(Debug, Eq, PartialEq)]
pub struct ExceptionDate {
///Date of exception
pub date: Date,
Expand Down

0 comments on commit 277488a

Please sign in to comment.