Skip to content

Commit

Permalink
Merge pull request #330 from platlas/clippy_lints
Browse files Browse the repository at this point in the history
clippy: Fix `items_after_test_module` and `unused_enumerate_index`
  • Loading branch information
platlas committed Jan 27, 2024
2 parents b604470 + 4ff28d5 commit 32e67f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/cubicbez.rs
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ mod tests {
for i in 0..10 {
let accuracy = 0.1f64.powi(i);
let mut worst: f64 = 0.0;
for (_count, (t0, t1, q)) in c.to_quads(accuracy).enumerate() {
for (t0, t1, q) in c.to_quads(accuracy) {
let epsilon = 1e-12;
assert!((q.start() - c.eval(t0)).hypot() < epsilon);
assert!((q.end() - c.eval(t1)).hypot() < epsilon);
Expand Down
32 changes: 16 additions & 16 deletions src/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,22 @@ impl fmt::Display for Point {
}
}

#[cfg(feature = "mint")]
impl From<Point> for mint::Point2<f64> {
#[inline]
fn from(p: Point) -> mint::Point2<f64> {
mint::Point2 { x: p.x, y: p.y }
}
}

#[cfg(feature = "mint")]
impl From<mint::Point2<f64>> for Point {
#[inline]
fn from(p: mint::Point2<f64>) -> Point {
Point { x: p.x, y: p.y }
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down Expand Up @@ -326,19 +342,3 @@ mod tests {
assert_eq!(format!("{p:.2}"), "(0.12, 9.88)");
}
}

#[cfg(feature = "mint")]
impl From<Point> for mint::Point2<f64> {
#[inline]
fn from(p: Point) -> mint::Point2<f64> {
mint::Point2 { x: p.x, y: p.y }
}
}

#[cfg(feature = "mint")]
impl From<mint::Point2<f64>> for Point {
#[inline]
fn from(p: mint::Point2<f64>) -> Point {
Point { x: p.x, y: p.y }
}
}

0 comments on commit 32e67f8

Please sign in to comment.