Apply lints and cleanup to Rust code

This commit is contained in:
Keavon Chambers
2023-01-29 03:01:57 -08:00
parent 5388b59e97
commit d990110f63
27 changed files with 122 additions and 119 deletions
+1 -10
View File
@@ -686,16 +686,7 @@ pub fn line_intersect_point(a: &Line, b: &Line) -> Option<Point> {
/// Returns intersection point and `t` values, treating lines as Bezier curves.
pub fn line_intersection(a: &Line, b: &Line) -> Option<Intersect> {
match line_intersection_unchecked(a, b) {
Some(intersect) => {
if valid_t(intersect.t_a) && valid_t(intersect.t_b) {
Some(intersect)
} else {
None
}
}
None => None,
}
line_intersection_unchecked(a, b).filter(|intersect| valid_t(intersect.t_a) && valid_t(intersect.t_b))
}
/// Returns intersection point and `t` values, treating lines as rays.