Fix a lot of Clippy warnings (#1808)

* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* bump msrv to 1.70.0 to silence warnings

* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* fix a few more warnings

* fix a clippy warning

* remove a commented out line

* silense too many arguments error

* fix more clippy warnings

* prefix underscore to unused vars/functions to fix warnings

* use filter instead of map

* move raw-rs-tests feature flat to module level to fix unused imports warnings

* fix a couple of unused result warnings

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Raminder Singh
2024-07-09 17:32:52 +05:30
committed by GitHub
parent f7ada701e5
commit 62f73df048
49 changed files with 264 additions and 260 deletions

View File

@@ -276,6 +276,12 @@ impl<I, O> PanicNode<I, O> {
}
}
impl<I, O> Default for PanicNode<I, O> {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod test {
use super::*;

View File

@@ -293,8 +293,8 @@ async fn brush(image: ImageFrame<Color>, bounds: ImageFrame<Color>, strokes: Vec
let image_bbox = Bbox::from_transform(image.transform).to_axis_aligned_bbox();
let bbox = if image_bbox.size().length() < 0.1 { stroke_bbox } else { stroke_bbox.union(&image_bbox) };
let mut draw_strokes: Vec<_> = strokes.iter().cloned().filter(|s| !matches!(s.style.blend_mode, BlendMode::Erase | BlendMode::Restore)).collect();
let erase_restore_strokes: Vec<_> = strokes.iter().cloned().filter(|s| matches!(s.style.blend_mode, BlendMode::Erase | BlendMode::Restore)).collect();
let mut draw_strokes: Vec<_> = strokes.iter().filter(|&s| !matches!(s.style.blend_mode, BlendMode::Erase | BlendMode::Restore)).cloned().collect();
let erase_restore_strokes: Vec<_> = strokes.iter().filter(|&s| matches!(s.style.blend_mode, BlendMode::Erase | BlendMode::Restore)).cloned().collect();
let mut brush_plan = cache.compute_brush_plan(image, &draw_strokes);

View File

@@ -590,8 +590,8 @@ pub struct NoisePatternNode<
cellular_jitter: CellularJitter,
}
#[allow(clippy::too_many_arguments)]
#[node_macro::node_fn(NoisePatternNode)]
#[allow(clippy::too_many_arguments)]
fn noise_pattern(
_no_primary_input: (),
dimensions: UVec2,

View File

@@ -31,7 +31,7 @@ use web_sys::window;
use web_sys::{CanvasRenderingContext2d, HtmlCanvasElement};
#[cfg(any(feature = "resvg", feature = "vello"))]
pub struct Canvas(CanvasRenderingContext2d);
pub struct Canvas(());
#[derive(Debug, Default)]
pub struct WasmApplicationIo {
@@ -316,7 +316,7 @@ fn render_svg(data: impl GraphicElementRendered, mut render: SvgRender, render_p
}
#[cfg(any(feature = "resvg", feature = "vello"))]
fn render_canvas(
fn _render_canvas(
data: impl GraphicElementRendered,
mut render: SvgRender,
render_params: RenderParams,
@@ -331,13 +331,13 @@ fn render_canvas(
let max = footprint.transform.inverse().transform_point2(resolution.as_dvec2());
render.format_svg(min, max);
let string = render.svg.to_svg_string();
let array = string.as_bytes();
let _array = string.as_bytes();
let canvas = &surface_handle.surface;
canvas.set_width(resolution.x);
canvas.set_height(resolution.y);
let usvg_tree = data.to_usvg_tree(resolution, [min, max]);
if let Some(exec) = editor.application_io.gpu_executor() {
if let Some(_exec) = editor.application_io.gpu_executor() {
todo!()
} else {
let pixmap_size = usvg_tree.size.to_int_size();