Update name of enum variant

This commit is contained in:
Hanno Braun 2022-03-16 15:34:14 +01:00
parent e632bd55ca
commit 218dfdbae2
2 changed files with 6 additions and 6 deletions

View File

@ -4,14 +4,14 @@ use crate::{Shape, Shape2d};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
#[repr(C)] #[repr(C)]
pub enum Shape3d { pub enum Shape3d {
/// The union of two 3-dimensional shapes
Group(Box<Group>),
/// A sweep of 2-dimensional shape along the z-axis /// A sweep of 2-dimensional shape along the z-axis
Sweep(Sweep), Sweep(Sweep),
/// A transformed 3-dimensional shape /// A transformed 3-dimensional shape
Transform(Box<Transform>), Transform(Box<Transform>),
/// The union of two 3-dimensional shapes
Union(Box<Group>),
} }
impl From<Shape3d> for Shape { impl From<Shape3d> for Shape {
@ -40,13 +40,13 @@ pub struct Group {
impl From<Group> for Shape { impl From<Group> for Shape {
fn from(shape: Group) -> Self { fn from(shape: Group) -> Self {
Self::Shape3d(Shape3d::Union(Box::new(shape))) Self::Shape3d(Shape3d::Group(Box::new(shape)))
} }
} }
impl From<Group> for Shape3d { impl From<Group> for Shape3d {
fn from(shape: Group) -> Self { fn from(shape: Group) -> Self {
Self::Union(Box::new(shape)) Self::Group(Box::new(shape))
} }
} }

View File

@ -53,9 +53,9 @@ macro_rules! dispatch {
$( $(
fn $method(&self, $($arg_name: $arg_ty,)*) -> $ret { fn $method(&self, $($arg_name: $arg_ty,)*) -> $ret {
match self { match self {
Self::Group(shape) => shape.$method($($arg_name,)*),
Self::Sweep(shape) => shape.$method($($arg_name,)*), Self::Sweep(shape) => shape.$method($($arg_name,)*),
Self::Transform(shape) => shape.$method($($arg_name,)*), Self::Transform(shape) => shape.$method($($arg_name,)*),
Self::Union(shape) => shape.$method($($arg_name,)*),
} }
} }
)* )*