Skip to content

Commit

Permalink
Merge pull request #710 from ArnaudOggy/fix_clippy
Browse files Browse the repository at this point in the history
[tech] Fix clippy
  • Loading branch information
ArnaudOggy authored Oct 9, 2020
2 parents ddf5490 + d72bd98 commit 9ad1a51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 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 = ["Kisio Digital <[email protected]>", "Guillaume Pinot <[email protected]>"]
name = "transit_model"
version = "0.31.4"
version = "0.31.5"
license = "AGPL-3.0-only"
description = "Transit data management"
repository = "https://github.com/CanalTP/transit_model"
Expand Down
15 changes: 6 additions & 9 deletions src/gtfs/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3143,19 +3143,16 @@ mod tests {
super::read_stops(&mut handler, &mut comments, &mut equipments).unwrap();
let stop_entrance = stop_locations
.values()
.filter(|sl| sl.stop_type == StopType::StopEntrance)
.collect::<Vec<_>>();
assert_eq!(1, stop_entrance.len());
.filter(|sl| sl.stop_type == StopType::StopEntrance);
assert_eq!(1, stop_entrance.count());
let stop_node = stop_locations
.values()
.filter(|sl| sl.stop_type == StopType::GenericNode)
.collect::<Vec<_>>();
assert_eq!(1, stop_node.len());
.filter(|sl| sl.stop_type == StopType::GenericNode);
assert_eq!(1, stop_node.count());
let stop_boarding = stop_locations
.values()
.filter(|sl| sl.stop_type == StopType::GenericNode)
.collect::<Vec<_>>();
assert_eq!(1, stop_boarding.len());
.filter(|sl| sl.stop_type == StopType::GenericNode);
assert_eq!(1, stop_boarding.count());
});
}
#[test]
Expand Down
8 changes: 5 additions & 3 deletions src/ntfs/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,11 @@ pub fn manage_stop_times(collections: &mut Collections, path: &path::Path) -> Re
);
}
let datetime_estimated = stop_time.datetime_estimated.map_or_else(
|| match collections.stop_points[stop_point_idx].stop_type {
StopType::Zone => true,
_ => false,
|| {
matches!(
collections.stop_points[stop_point_idx].stop_type,
StopType::Zone
)
},
|v| v != 0,
);
Expand Down

0 comments on commit 9ad1a51

Please sign in to comment.