Skip to content

Commit

Permalink
Merge pull request #571 from woshilapin/rust-1.42.0
Browse files Browse the repository at this point in the history
[tech] Fix some new clippy errors
  • Loading branch information
Jean SIMARD authored Mar 13, 2020
2 parents 818733e + e9861ba commit 4cbe9ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gtfs/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fn get_gtfs_trip_shortname_and_headsign_from_ntfs_vj(
}

fn get_gtfs_direction_id_from_ntfs_route(route: &objects::Route) -> DirectionType {
match route.direction_type.as_ref().map(|s| s.as_str()) {
match route.direction_type.as_deref() {
Some("forward") | Some("clockwise") | Some("inbound") => DirectionType::Forward,
_ => DirectionType::Backward,
}
Expand Down
2 changes: 1 addition & 1 deletion src/netex_france/offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl<'a> OfferExporter<'a> {
let element_builder = element_builder.append(Self::generate_distance());
let element_builder = element_builder.append(Self::generate_line_ref(&route.line_id));
let element_builder = if let Some(direction_type_element) =
Self::generate_direction_type(route.direction_type.as_ref().map(String::as_str))
Self::generate_direction_type(route.direction_type.as_deref())
{
element_builder.append(direction_type_element)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/ntfs/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ lazy_static! {
Ok(model
.lines
.values()
.filter(|line| line.code.as_ref().map(|line_code| line_code.as_str()) == Some(line_code))
.filter(|line| line.code.as_deref() == Some(line_code))
// Unwrap is safe because we're iterating on model.lines already
.map(|line| model.lines.get_idx(&line.id).unwrap())
.flat_map(|line_idx| model.get_corresponding_from_idx(line_idx))
Expand Down

0 comments on commit 4cbe9ab

Please sign in to comment.