From bd514c059428162f4f48ee31e055176e320c6a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Torr=C3=B3?= Date: Thu, 8 May 2025 11:07:36 +0200 Subject: [PATCH] :wrench: Fix linting warnings and errors (#6431) --- render-wasm/src/render/gpu_state.rs | 2 +- render-wasm/src/shapes.rs | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/render-wasm/src/render/gpu_state.rs b/render-wasm/src/render/gpu_state.rs index 6d2ff87d0..02b74f49d 100644 --- a/render-wasm/src/render/gpu_state.rs +++ b/render-wasm/src/render/gpu_state.rs @@ -1,5 +1,5 @@ use skia_safe::gpu::{self, gl::FramebufferInfo, gl::TextureInfo, DirectContext}; -use skia_safe::{self as skia, ISize, Surface, SurfaceProps, SurfacePropsFlags}; +use skia_safe::{self as skia, ISize}; pub struct GpuState { pub context: DirectContext, diff --git a/render-wasm/src/shapes.rs b/render-wasm/src/shapes.rs index 24f585966..afbd3177c 100644 --- a/render-wasm/src/shapes.rs +++ b/render-wasm/src/shapes.rs @@ -827,10 +827,9 @@ impl Shape { paint.set_blend_mode(skia::BlendMode::SrcATop); paint.set_anti_alias(true); paint.set_stroke_width(stroke.width * 2.0); - paint.set_color(match &stroke.fill { - Fill::Solid(color) => *color, - _ => Color::BLACK, - }); + if let Fill::Solid(SolidColor(color)) = stroke.fill { + paint.set_color(color); + } paints.push(paint); } StrokeKind::CenterStroke => { @@ -838,10 +837,9 @@ impl Shape { paint.set_style(skia::PaintStyle::Stroke); paint.set_anti_alias(true); paint.set_stroke_width(stroke.width); - paint.set_color(match &stroke.fill { - Fill::Solid(color) => *color, - _ => Color::BLACK, - }); + if let Fill::Solid(SolidColor(color)) = stroke.fill { + paint.set_color(color); + } paints.push(paint); } StrokeKind::OuterStroke => { @@ -850,10 +848,9 @@ impl Shape { paint.set_blend_mode(skia::BlendMode::DstOver); paint.set_anti_alias(true); paint.set_stroke_width(stroke.width * 2.0); - paint.set_color(match &stroke.fill { - Fill::Solid(color) => *color, - _ => Color::BLACK, - }); + if let Fill::Solid(SolidColor(color)) = stroke.fill { + paint.set_color(color); + } paints.push(paint); let mut paint = skia::Paint::default();