chore: Appease clippy

This commit is contained in:
relrelb 2021-03-20 19:15:16 +02:00 committed by Mike Welsh
parent 648e14e057
commit 15c1cf5bf6
2 changed files with 12 additions and 6 deletions

View File

@ -46,8 +46,12 @@ impl ShapeTessellator {
match path {
DrawPath::Fill { style, commands } => match style {
swf::FillStyle::Color(color) => {
let mut buffers_builder =
BuffersBuilder::new(&mut lyon_mesh, RuffleVertexCtor { color: *color });
let mut buffers_builder = BuffersBuilder::new(
&mut lyon_mesh,
RuffleVertexCtor {
color: color.clone(),
},
);
if let Err(e) = self.fill_tess.tessellate_path(
&ruffle_path_to_lyon_path(commands, true),
@ -202,7 +206,9 @@ impl ShapeTessellator {
} => {
let mut buffers_builder = BuffersBuilder::new(
&mut lyon_mesh,
RuffleVertexCtor { color: style.color },
RuffleVertexCtor {
color: style.color.clone(),
},
);
// TODO(Herschel): 0 width indicates "hairline".
@ -453,7 +459,7 @@ impl FillVertexConstructor<Vertex> for RuffleVertexCtor {
Vertex {
x: vertex.position().x,
y: vertex.position().y,
color: self.color,
color: self.color.clone(),
}
}
}
@ -463,7 +469,7 @@ impl StrokeVertexConstructor<Vertex> for RuffleVertexCtor {
Vertex {
x: vertex.position().x,
y: vertex.position().y,
color: self.color,
color: self.color.clone(),
}
}
}

View File

@ -254,7 +254,7 @@ pub struct Rectangle {
/// An RGBA (red, green, blue, alpha) color.
///
/// All components are stored as [`u8`] and have a color range of 0-255.
#[derive(Debug, PartialEq, Clone, Copy)]
#[derive(Debug, PartialEq, Clone)]
pub struct Color {
/// The red component value.
pub r: u8,