From fd9980adad3f26e6cf8da9c7f7f6b997c7901106 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 8 May 2024 13:42:01 +0200 Subject: [PATCH] Take `self` in `ReverseCurveCoordinateSystems` This provides some more flexibility regarding the type that the trait is implemented for. --- crates/fj-core/src/operations/reverse/cycle.rs | 4 ++-- crates/fj-core/src/operations/reverse/face.rs | 4 ++-- crates/fj-core/src/operations/reverse/half_edge.rs | 4 ++-- crates/fj-core/src/operations/reverse/mod.rs | 2 +- crates/fj-core/src/operations/reverse/region.rs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/fj-core/src/operations/reverse/cycle.rs b/crates/fj-core/src/operations/reverse/cycle.rs index b25627f1b..229d147cf 100644 --- a/crates/fj-core/src/operations/reverse/cycle.rs +++ b/crates/fj-core/src/operations/reverse/cycle.rs @@ -33,11 +33,11 @@ impl Reverse for Cycle { } } -impl ReverseCurveCoordinateSystems for Cycle { +impl ReverseCurveCoordinateSystems for &Cycle { type Reversed = Cycle; fn reverse_curve_coordinate_systems( - &self, + self, core: &mut Core, ) -> Self::Reversed { let edges = self diff --git a/crates/fj-core/src/operations/reverse/face.rs b/crates/fj-core/src/operations/reverse/face.rs index 218886e6a..0a429ed89 100644 --- a/crates/fj-core/src/operations/reverse/face.rs +++ b/crates/fj-core/src/operations/reverse/face.rs @@ -42,11 +42,11 @@ impl Reverse for Polygon { } } -impl ReverseCurveCoordinateSystems for Face { +impl ReverseCurveCoordinateSystems for &Face { type Reversed = Face; fn reverse_curve_coordinate_systems( - &self, + self, core: &mut Core, ) -> Self::Reversed { let region = self diff --git a/crates/fj-core/src/operations/reverse/half_edge.rs b/crates/fj-core/src/operations/reverse/half_edge.rs index 590b92cd6..24275db32 100644 --- a/crates/fj-core/src/operations/reverse/half_edge.rs +++ b/crates/fj-core/src/operations/reverse/half_edge.rs @@ -7,11 +7,11 @@ use crate::{ use super::ReverseCurveCoordinateSystems; -impl ReverseCurveCoordinateSystems for Handle { +impl ReverseCurveCoordinateSystems for &Handle { type Reversed = Handle; fn reverse_curve_coordinate_systems( - &self, + self, core: &mut Core, ) -> Self::Reversed { let mut half_edge_geom = *core.layers.geometry.of_half_edge(self); diff --git a/crates/fj-core/src/operations/reverse/mod.rs b/crates/fj-core/src/operations/reverse/mod.rs index 1f2aa5cfd..e2b70bd02 100644 --- a/crates/fj-core/src/operations/reverse/mod.rs +++ b/crates/fj-core/src/operations/reverse/mod.rs @@ -24,7 +24,7 @@ pub trait ReverseCurveCoordinateSystems { /// This will not have any effect on object positions in global coordinates. #[must_use] fn reverse_curve_coordinate_systems( - &self, + self, core: &mut Core, ) -> Self::Reversed; } diff --git a/crates/fj-core/src/operations/reverse/region.rs b/crates/fj-core/src/operations/reverse/region.rs index dbef23a6f..3e262a0a4 100644 --- a/crates/fj-core/src/operations/reverse/region.rs +++ b/crates/fj-core/src/operations/reverse/region.rs @@ -21,11 +21,11 @@ impl Reverse for Region { } } -impl ReverseCurveCoordinateSystems for Region { +impl ReverseCurveCoordinateSystems for &Region { type Reversed = Region; fn reverse_curve_coordinate_systems( - &self, + self, core: &mut Core, ) -> Self::Reversed { let exterior = self