diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/core_shapes.rs | 2 | ||||
-rw-r--r-- | core/src/solving.rs | 6 | ||||
-rw-r--r-- | core/src/styles.rs | 7 |
3 files changed, 6 insertions, 9 deletions
diff --git a/core/src/core_shapes.rs b/core/src/core_shapes.rs index c3d3cae..805d82e 100644 --- a/core/src/core_shapes.rs +++ b/core/src/core_shapes.rs | |||
@@ -30,7 +30,7 @@ pub struct Rectangle {} | |||
30 | 30 | ||
31 | impl CoreShape for Rectangle { | 31 | impl CoreShape for Rectangle { |
32 | fn to_render(&self, _model: &dyn SolverModel) -> Option<Box<dyn Render>> { | 32 | fn to_render(&self, _model: &dyn SolverModel) -> Option<Box<dyn Render>> { |
33 | Some(Box::new(self.clone())) | 33 | Some(Box::new(*self)) |
34 | } | 34 | } |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/core/src/solving.rs b/core/src/solving.rs index c7e94ba..4760611 100644 --- a/core/src/solving.rs +++ b/core/src/solving.rs | |||
@@ -196,7 +196,7 @@ impl Constrainable for StrokeStyle { | |||
196 | }; | 196 | }; |
197 | 197 | ||
198 | Some(DefinedStrokeStyle { | 198 | Some(DefinedStrokeStyle { |
199 | pattern: self.pattern.clone(), | 199 | pattern: self.pattern, |
200 | dash, | 200 | dash, |
201 | line_width: self.line_width.fixate(model)?, | 201 | line_width: self.line_width.fixate(model)?, |
202 | }) | 202 | }) |
@@ -249,7 +249,7 @@ impl Constrainable for FontDescription { | |||
249 | family: self.family.clone(), | 249 | family: self.family.clone(), |
250 | style: self.style, | 250 | style: self.style, |
251 | weight: self.weight, | 251 | weight: self.weight, |
252 | size: self.size.fixate(&*model)?, | 252 | size: self.size.fixate(model)?, |
253 | }) | 253 | }) |
254 | } | 254 | } |
255 | } | 255 | } |
@@ -260,7 +260,7 @@ impl Constrainable for Text { | |||
260 | fn fixate(&self, model: &dyn SolverModel) -> Option<Self::Fixated> { | 260 | fn fixate(&self, model: &dyn SolverModel) -> Option<Self::Fixated> { |
261 | Some(DefinedText { | 261 | Some(DefinedText { |
262 | content: self.content.clone(), | 262 | content: self.content.clone(), |
263 | font: self.font.fixate(&*model)?, | 263 | font: self.font.fixate(model)?, |
264 | }) | 264 | }) |
265 | } | 265 | } |
266 | } | 266 | } |
diff --git a/core/src/styles.rs b/core/src/styles.rs index c061c58..73373ba 100644 --- a/core/src/styles.rs +++ b/core/src/styles.rs | |||
@@ -10,10 +10,7 @@ pub enum Pattern { | |||
10 | 10 | ||
11 | impl Pattern { | 11 | impl Pattern { |
12 | pub fn is_none(&self) -> bool { | 12 | pub fn is_none(&self) -> bool { |
13 | match self { | 13 | matches!(self, Pattern::None) |
14 | Pattern::None => true, | ||
15 | _ => false, | ||
16 | } | ||
17 | } | 14 | } |
18 | } | 15 | } |
19 | 16 | ||
@@ -97,7 +94,7 @@ impl StrokeStyleBuilder { | |||
97 | 94 | ||
98 | pub fn build(&mut self) -> StrokeStyle { | 95 | pub fn build(&mut self) -> StrokeStyle { |
99 | StrokeStyle { | 96 | StrokeStyle { |
100 | pattern: self.pattern.clone().unwrap_or_default(), | 97 | pattern: self.pattern.unwrap_or_default(), |
101 | dash: self.dash.clone(), | 98 | dash: self.dash.clone(), |
102 | line_width: self.line_width.unwrap_or(Float::Fixed(2.)), | 99 | line_width: self.line_width.unwrap_or(Float::Fixed(2.)), |
103 | } | 100 | } |