Move `impl` blocks closer to related type

This commit is contained in:
Hanno Braun 2022-11-07 15:32:31 +01:00
parent 20181e4d4d
commit 57c627edea
1 changed files with 12 additions and 12 deletions

View File

@ -134,6 +134,18 @@ impl Sketch {
} }
} }
impl From<Sketch> for Shape {
fn from(shape: Sketch) -> Self {
Self::Shape2d(shape.into())
}
}
impl From<Sketch> for Shape2d {
fn from(shape: Sketch) -> Self {
Shape2d::Sketch(shape)
}
}
/// A chain of elements that is part of a [`Sketch`] /// A chain of elements that is part of a [`Sketch`]
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
@ -187,15 +199,3 @@ impl PolyChain {
self.points.clone().into() self.points.clone().into()
} }
} }
impl From<Sketch> for Shape {
fn from(shape: Sketch) -> Self {
Self::Shape2d(shape.into())
}
}
impl From<Sketch> for Shape2d {
fn from(shape: Sketch) -> Self {
Shape2d::Sketch(shape)
}
}