diff --git a/crates/encoding/src/lib.rs b/crates/encoding/src/lib.rs index 3dbdb52f8..fd7cb1622 100644 --- a/crates/encoding/src/lib.rs +++ b/crates/encoding/src/lib.rs @@ -3,7 +3,7 @@ //! Raw scene encoding. -#![warn(clippy::doc_markdown)] +#![warn(clippy::doc_markdown, clippy::semicolon_if_nothing_returned)] mod binning; mod clip; diff --git a/crates/encoding/src/math.rs b/crates/encoding/src/math.rs index 45b9fcfa9..d9cec4b32 100644 --- a/crates/encoding/src/math.rs +++ b/crates/encoding/src/math.rs @@ -131,7 +131,7 @@ mod tests { fn test_f32_to_f16_simple() { let input: f32 = std::f32::consts::PI; let output: u16 = f32_to_f16(input); - assert_eq!(0x4248u16, output) // 3.141 + assert_eq!(0x4248u16, output); // 3.141 } #[test] diff --git a/crates/encoding/src/path.rs b/crates/encoding/src/path.rs index 653bb6f50..5676398fc 100644 --- a/crates/encoding/src/path.rs +++ b/crates/encoding/src/path.rs @@ -563,7 +563,7 @@ impl<'a> PathEncoder<'a> { PathEl::MoveTo(p0) => self.move_to(p0.x as f32, p0.y as f32), PathEl::LineTo(p0) => self.line_to(p0.x as f32, p0.y as f32), PathEl::QuadTo(p0, p1) => { - self.quad_to(p0.x as f32, p0.y as f32, p1.x as f32, p1.y as f32) + self.quad_to(p0.x as f32, p0.y as f32, p1.x as f32, p1.y as f32); } PathEl::CurveTo(p0, p1, p2) => self.cubic_to( p0.x as f32, @@ -608,23 +608,23 @@ impl<'a> PathEncoder<'a> { #[cfg(feature = "full")] impl fello::scale::Pen for PathEncoder<'_> { fn move_to(&mut self, x: f32, y: f32) { - self.move_to(x, y) + self.move_to(x, y); } fn line_to(&mut self, x: f32, y: f32) { - self.line_to(x, y) + self.line_to(x, y); } fn quad_to(&mut self, cx0: f32, cy0: f32, x: f32, y: f32) { - self.quad_to(cx0, cy0, x, y) + self.quad_to(cx0, cy0, x, y); } fn curve_to(&mut self, cx0: f32, cy0: f32, cx1: f32, cy1: f32, x: f32, y: f32) { - self.cubic_to(cx0, cy0, cx1, cy1, x, y) + self.cubic_to(cx0, cy0, cx1, cy1, x, y); } fn close(&mut self) { - self.close() + self.close(); } } diff --git a/crates/shaders/src/compile/preprocess.rs b/crates/shaders/src/compile/preprocess.rs index b458ebe89..b3c600350 100644 --- a/crates/shaders/src/compile/preprocess.rs +++ b/crates/shaders/src/compile/preprocess.rs @@ -93,7 +93,7 @@ pub fn preprocess( eprintln!( "Second else for same ifdef/ifndef (line {line_number}); \ ignoring second else" - ) + ); } else { item.else_passed = true; item.active = !item.active; diff --git a/crates/shaders/src/lib.rs b/crates/shaders/src/lib.rs index 645544e9e..b129dabd8 100644 --- a/crates/shaders/src/lib.rs +++ b/crates/shaders/src/lib.rs @@ -1,7 +1,7 @@ // Copyright 2023 The Vello authors // SPDX-License-Identifier: Apache-2.0 OR MIT -#![warn(clippy::doc_markdown)] +#![warn(clippy::doc_markdown, clippy::semicolon_if_nothing_returned)] mod types; diff --git a/examples/scenes/src/download.rs b/examples/scenes/src/download.rs index 3f3eb512a..a1a436b4a 100644 --- a/examples/scenes/src/download.rs +++ b/examples/scenes/src/download.rs @@ -88,7 +88,7 @@ impl Download { "{index}: Downloading {} from {}", download.name, download.url ); - download.fetch(&self.directory, self.size_limit)? + download.fetch(&self.directory, self.size_limit)?; } println!("{} downloads complete", to_download.len()); Ok(()) diff --git a/examples/scenes/src/svg.rs b/examples/scenes/src/svg.rs index fc1350bd5..dc0c13d8a 100644 --- a/examples/scenes/src/svg.rs +++ b/examples/scenes/src/svg.rs @@ -53,7 +53,7 @@ fn scene_from_files_inner( if let Some(extension) = Path::new(&entry.file_name()).extension() { if extension == "svg" { count += 1; - scenes.push(example_scene_of(entry.path())) + scenes.push(example_scene_of(entry.path())); } } } @@ -63,7 +63,7 @@ fn scene_from_files_inner( empty_dir(); } } else { - scenes.push(example_scene_of(path.to_owned())) + scenes.push(example_scene_of(path.to_owned())); } } Ok(SceneSet { scenes }) @@ -147,7 +147,7 @@ pub fn svg_function_of>( Result::Ok((scene_frag, resolution)) => { builder.append(&scene_frag, None); params.resolution = Some(resolution); - cached_scene = Some((scene_frag, resolution)) + cached_scene = Some((scene_frag, resolution)); } Err(RecvTimeoutError::Timeout) => params.text.add( builder, diff --git a/examples/scenes/src/test_scenes.rs b/examples/scenes/src/test_scenes.rs index 1a9e0ac83..f12ff17ea 100644 --- a/examples/scenes/src/test_scenes.rs +++ b/examples/scenes/src/test_scenes.rs @@ -1117,7 +1117,7 @@ fn labyrinth(sb: &mut SceneBuilder, _: &mut SceneParams) { Color::rgba8(0x70, 0x80, 0x80, 0xff), None, &path, - ) + ); } fn robust_paths(sb: &mut SceneBuilder, _: &mut SceneParams) { diff --git a/examples/with_winit/src/lib.rs b/examples/with_winit/src/lib.rs index 225f3ea87..a9f54d9ab 100644 --- a/examples/with_winit/src/lib.rs +++ b/examples/with_winit/src/lib.rs @@ -203,7 +203,7 @@ fn run( profile_result, ) { Ok(()) => { - println!("Wrote trace to path {path:?}") + println!("Wrote trace to path {path:?}"); } Err(e) => eprintln!("Failed to write trace {e}"), } @@ -415,7 +415,7 @@ fn run( width as f64, height as f64, profiling_result, - ) + ); } } let surface_texture = render_state diff --git a/integrations/vello_svg/src/lib.rs b/integrations/vello_svg/src/lib.rs index 2aa3a87d5..4b6fba451 100644 --- a/integrations/vello_svg/src/lib.rs +++ b/integrations/vello_svg/src/lib.rs @@ -48,7 +48,7 @@ pub use usvg; /// /// See the [module level documentation](crate#unsupported-features) for a list of some unsupported svg features pub fn render_tree(sb: &mut SceneBuilder, svg: &usvg::Tree) { - render_tree_with(sb, svg, default_error_handler).unwrap_or_else(|e| match e {}) + render_tree_with(sb, svg, default_error_handler).unwrap_or_else(|e| match e {}); } /// Append a [`usvg::Tree`] into a Vello [`SceneBuilder`]. @@ -81,13 +81,13 @@ pub fn render_tree_with Result<(), E local_path.move_to(most_recent_initial); } most_recent_initial = (x, y); - local_path.move_to(most_recent_initial) + local_path.move_to(most_recent_initial); } usvg::PathSegment::LineTo { x, y } => { if std::mem::take(&mut just_closed) { local_path.move_to(most_recent_initial); } - local_path.line_to((x, y)) + local_path.line_to((x, y)); } usvg::PathSegment::CurveTo { x1, @@ -100,11 +100,11 @@ pub fn render_tree_with Result<(), E if std::mem::take(&mut just_closed) { local_path.move_to(most_recent_initial); } - local_path.curve_to((x1, y1), (x2, y2), (x, y)) + local_path.curve_to((x1, y1), (x2, y2), (x, y)); } usvg::PathSegment::ClosePath => { just_closed = true; - local_path.close_path() + local_path.close_path(); } } } diff --git a/src/glyph.rs b/src/glyph.rs index 84e9ef30d..e10b3f6fd 100644 --- a/src/glyph.rs +++ b/src/glyph.rs @@ -139,16 +139,16 @@ struct BezPathPen(peniko::kurbo::BezPath); impl Pen for BezPathPen { fn move_to(&mut self, x: f32, y: f32) { - self.0.move_to((x as f64, y as f64)) + self.0.move_to((x as f64, y as f64)); } fn line_to(&mut self, x: f32, y: f32) { - self.0.line_to((x as f64, y as f64)) + self.0.line_to((x as f64, y as f64)); } fn quad_to(&mut self, cx0: f32, cy0: f32, x: f32, y: f32) { self.0 - .quad_to((cx0 as f64, cy0 as f64), (x as f64, y as f64)) + .quad_to((cx0 as f64, cy0 as f64), (x as f64, y as f64)); } fn curve_to(&mut self, cx0: f32, cy0: f32, cx1: f32, cy1: f32, x: f32, y: f32) { @@ -156,10 +156,10 @@ impl Pen for BezPathPen { (cx0 as f64, cy0 as f64), (cx1 as f64, cy1 as f64), (x as f64, y as f64), - ) + ); } fn close(&mut self) { - self.0.close_path() + self.0.close_path(); } } diff --git a/src/lib.rs b/src/lib.rs index c53b835c9..b2554c2b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ // // Also licensed under MIT license, at your choice. -#![warn(clippy::doc_markdown)] +#![warn(clippy::doc_markdown, clippy::semicolon_if_nothing_returned)] mod cpu_dispatch; mod cpu_shader; diff --git a/src/shaders/preprocess.rs b/src/shaders/preprocess.rs index 97367b846..0b7091213 100644 --- a/src/shaders/preprocess.rs +++ b/src/shaders/preprocess.rs @@ -80,7 +80,7 @@ pub fn preprocess(input: &str, defines: &HashSet, imports: &HashMap<&str let item = stack.last_mut(); if let Some(item) = item { if item.else_passed { - eprintln!("Second else for same ifdef/ifndef (line {line_number}); ignoring second else") + eprintln!("Second else for same ifdef/ifndef (line {line_number}); ignoring second else"); } else { item.else_passed = true; item.active = !item.active; diff --git a/src/wgpu_engine.rs b/src/wgpu_engine.rs index e90946f69..1f2fce0ee 100644 --- a/src/wgpu_engine.rs +++ b/src/wgpu_engine.rs @@ -345,7 +345,7 @@ impl WgpuEngine { }, ); self.bind_map - .insert_image(image_proxy.id, texture, texture_view) + .insert_image(image_proxy.id, texture, texture_view); } Command::WriteImage(proxy, [x, y, width, height], data) => { if let Ok((texture, _)) = self.bind_map.get_or_create_image(*proxy, device) { @@ -755,7 +755,7 @@ impl<'a> TransientBindMap<'a> { }); } Entry::Occupied(mut o) => { - o.get_mut().upload_if_needed(proxy, device, queue, pool) + o.get_mut().upload_if_needed(proxy, device, queue, pool); } } }