Skip to content

Commit

Permalink
Merge pull request #935 from hove-io/clippy
Browse files Browse the repository at this point in the history
[tech] fix clippy warnings
  • Loading branch information
datanel authored Jan 9, 2024
2 parents 9a58dc7 + 28f0f56 commit 4e86b91
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ impl Collections {
// [0,1] and [22,23] will become [22,23,0,1]
if i == HOURS_PER_DAY - 1
&& holes.len() > 1
&& holes.get(0).filter(|h0| h0.contains(&0)).is_some()
&& holes.first().filter(|h0| h0.contains(&0)).is_some()
{
let hole0 = holes[0].clone();
if let Some(last) = holes.last_mut() {
Expand Down Expand Up @@ -1142,7 +1142,7 @@ impl Collections {
mut stop_areas: Vec<&StopArea>,
) -> Option<&StopArea> {
stop_areas.sort_by_key(|stop_area| &stop_area.name);
stop_areas.get(0).cloned()
stop_areas.first().cloned()
}
fn find_best_stop_area_for<'a, F>(
collections: &'a Collections,
Expand Down
1 change: 0 additions & 1 deletion src/ntfs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ mod tests {
collections
.feed_infos
.into_iter()
.map(|(k, v)| (k, v))
.collect::<Vec<(String, String)>>()
);
});
Expand Down
4 changes: 2 additions & 2 deletions src/vptranslator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ mod tests {
date: Date::from_ymd_opt(2012, 7, 13).unwrap(),
exception_type: ExceptionType::Remove,
},
res.exceptions.get(0).unwrap()
res.exceptions.first().unwrap()
);
assert_eq!(
ValidityPeriod {
Expand All @@ -486,7 +486,7 @@ mod tests {
date: Date::from_ymd_opt(2012, 7, 12).unwrap(),
exception_type: ExceptionType::Add,
},
res.exceptions.get(0).unwrap()
res.exceptions.first().unwrap()
);
assert_eq!(
ValidityPeriod {
Expand Down

0 comments on commit 4e86b91

Please sign in to comment.