From 85c7253bcfad68a3d6148cb3059208bdd4a42d14 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 18 Feb 2025 20:05:08 +0100 Subject: [PATCH] Simplify return value of `ConnectExt::connect` --- experiments/2024-12-09/src/topology/connect.rs | 8 +++----- experiments/2024-12-09/src/topology/sweep.rs | 9 +++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/experiments/2024-12-09/src/topology/connect.rs b/experiments/2024-12-09/src/topology/connect.rs index 89209890d..6252197aa 100644 --- a/experiments/2024-12-09/src/topology/connect.rs +++ b/experiments/2024-12-09/src/topology/connect.rs @@ -25,11 +25,11 @@ pub trait ConnectExt { /// /// It should be seen as more of a placeholder for a real implementation of /// this operation. - fn connect(self, other: Self) -> Connect; + fn connect(self, other: Self) -> Handle; } impl ConnectExt for Handle { - fn connect(self, other: Self) -> Connect { + fn connect(self, other: Self) -> Handle { assert_eq!( self.output().vertices().count(), other.output().vertices().count(), @@ -53,9 +53,7 @@ impl ConnectExt for Handle { .collect::>(); let output = Solid::new([self, other].into_iter().chain(side_faces)); - Connect { - output: Handle::new(output), - } + Handle::new(output) } } diff --git a/experiments/2024-12-09/src/topology/sweep.rs b/experiments/2024-12-09/src/topology/sweep.rs index 177ba5258..ca0a8712d 100644 --- a/experiments/2024-12-09/src/topology/sweep.rs +++ b/experiments/2024-12-09/src/topology/sweep.rs @@ -7,10 +7,7 @@ use crate::{ }; use super::{ - connect::{Connect, ConnectExt}, - face::Face, - flip::FlipExt, - solid::Solid, + connect::ConnectExt, face::Face, flip::FlipExt, solid::Solid, translate::TranslateExt, }; @@ -40,7 +37,7 @@ impl SweepExt for Handle { } pub struct Sweep { - pub output: Connect, + pub output: Handle, } impl Operation for Sweep { @@ -59,6 +56,6 @@ impl Operation for Sweep { impl OperationOutput for Sweep { fn output(&self) -> &Solid { - self.output.output.output() + self.output.output() } }