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 { match path {
DrawPath::Fill { style, commands } => match style { DrawPath::Fill { style, commands } => match style {
swf::FillStyle::Color(color) => { swf::FillStyle::Color(color) => {
let mut buffers_builder = let mut buffers_builder = BuffersBuilder::new(
BuffersBuilder::new(&mut lyon_mesh, RuffleVertexCtor { color: *color }); &mut lyon_mesh,
RuffleVertexCtor {
color: color.clone(),
},
);
if let Err(e) = self.fill_tess.tessellate_path( if let Err(e) = self.fill_tess.tessellate_path(
&ruffle_path_to_lyon_path(commands, true), &ruffle_path_to_lyon_path(commands, true),
@ -202,7 +206,9 @@ impl ShapeTessellator {
} => { } => {
let mut buffers_builder = BuffersBuilder::new( let mut buffers_builder = BuffersBuilder::new(
&mut lyon_mesh, &mut lyon_mesh,
RuffleVertexCtor { color: style.color }, RuffleVertexCtor {
color: style.color.clone(),
},
); );
// TODO(Herschel): 0 width indicates "hairline". // TODO(Herschel): 0 width indicates "hairline".
@ -453,7 +459,7 @@ impl FillVertexConstructor<Vertex> for RuffleVertexCtor {
Vertex { Vertex {
x: vertex.position().x, x: vertex.position().x,
y: vertex.position().y, y: vertex.position().y,
color: self.color, color: self.color.clone(),
} }
} }
} }
@ -463,7 +469,7 @@ impl StrokeVertexConstructor<Vertex> for RuffleVertexCtor {
Vertex { Vertex {
x: vertex.position().x, x: vertex.position().x,
y: vertex.position().y, 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. /// An RGBA (red, green, blue, alpha) color.
/// ///
/// All components are stored as [`u8`] and have a color range of 0-255. /// 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 { pub struct Color {
/// The red component value. /// The red component value.
pub r: u8, pub r: u8,