Skip to content

Commit

Permalink
Clippy: replace filter.next with find
Browse files Browse the repository at this point in the history
  • Loading branch information
Logicalshift committed Mar 6, 2022
1 parent 097197f commit 0e53d31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/bezier/intersection/self_intersection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ where C::Point: Coordinate+Coordinate2D {
} else {
// Intersection may include the point between the left and right curves (ignore any point that's at t=1 on the left or t=0 on the right)
intersections.into_iter()
.filter(|(t1, t2)| *t1 < 1.0 && *t2 > 0.0)
.next()
.find(|(t1, t2)| *t1 < 1.0 && *t2 > 0.0)
.map(|(t1, t2)| (left.t_for_t(t1), right.t_for_t(t2)))
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/bezier/path/ray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,7 @@ where L: Line<Point=Path::Point> {
let previous_edge = path.reverse_edges_for_point(edge.start_idx)
.into_iter()
.map(|previous_edge| previous_edge.reversed())
.filter(|previous_edge| path.edge_following_edge_idx(*previous_edge) == edge.edge_idx)
.next()
.find(|previous_edge| path.edge_following_edge_idx(*previous_edge) == edge.edge_idx)
.expect("Previous edge for a collision at start");

(previous_edge, edge)
Expand Down

0 comments on commit 0e53d31

Please sign in to comment.