From 885bc60cfae4f6094f83b16f0eb0b1baf0cef26d Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sun, 24 Mar 2024 23:39:58 +0700 Subject: [PATCH] clippy: Fix `semicolon_if_nothing_returned` lints. --- benches/throughput.rs | 10 +++++----- src/core/rw.rs | 10 +++++----- src/core/traits.rs | 2 +- src/types/array.rs | 4 ++-- tests/assert_uniform_compat_fail.rs | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/benches/throughput.rs b/benches/throughput.rs index dd90364..600cbe3 100644 --- a/benches/throughput.rs +++ b/benches/throughput.rs @@ -136,35 +136,35 @@ fn bench(c: &mut Criterion) { || create_vecs(a, size), |(src, dst)| dst.write(src).unwrap(), criterion::BatchSize::LargeInput, - ) + ); }); group.bench_function(format!("{name}_read"), |b| { b.iter_batched_ref( || create_vecs(a, size), |(src, dst)| dst.read(src).unwrap(), criterion::BatchSize::LargeInput, - ) + ); }); group.bench_function(format!("{name}_create"), |b| { b.iter_batched_ref( || create_vecs(a, size), |(_src, dst)| dst.create::>().unwrap(), criterion::BatchSize::LargeInput, - ) + ); }); group.bench_function(format!("{name}_manual"), |b| { b.iter_batched_ref( || create_aligned_vecs(size), |(dst, src)| manual_memcpy(dst, src), criterion::BatchSize::LargeInput, - ) + ); }); group.bench_function(format!("{name}_stdlib"), |b| { b.iter_batched_ref( || create_aligned_vecs(size), |(dst, src)| dst.copy_from_slice(src), criterion::BatchSize::LargeInput, - ) + ); }); } diff --git a/src/core/rw.rs b/src/core/rw.rs index 83a9805..5947ce6 100644 --- a/src/core/rw.rs +++ b/src/core/rw.rs @@ -43,12 +43,12 @@ impl Writer { #[inline] pub fn advance(&mut self, amount: usize) { - self.cursor.advance(amount) + self.cursor.advance(amount); } #[inline] pub fn write(&mut self, val: &[u8; N]) { - self.cursor.write(val) + self.cursor.write(val); } } @@ -85,7 +85,7 @@ impl Reader { #[inline] pub fn advance(&mut self, amount: usize) { - self.cursor.advance(amount) + self.cursor.advance(amount); } #[inline] @@ -239,7 +239,7 @@ impl BufferMut for [u8; LEN] { #[inline] fn write(&mut self, offset: usize, val: &[u8; N]) { - <[u8] as BufferMut>::write(self, offset, val) + <[u8] as BufferMut>::write(self, offset, val); } } @@ -251,7 +251,7 @@ impl BufferMut for Vec { #[inline] fn write(&mut self, offset: usize, val: &[u8; N]) { - <[u8] as BufferMut>::write(self, offset, val) + <[u8] as BufferMut>::write(self, offset, val); } #[inline] diff --git a/src/core/traits.rs b/src/core/traits.rs index 60caa5c..10ee6c0 100644 --- a/src/core/traits.rs +++ b/src/core/traits.rs @@ -185,7 +185,7 @@ pub trait ShaderType { /// ``` #[inline] fn assert_uniform_compat() { - Self::UNIFORM_COMPAT_ASSERT() + Self::UNIFORM_COMPAT_ASSERT(); } // fn assert_can_write_into() diff --git a/src/types/array.rs b/src/types/array.rs index b94c5ab..6a20f16 100644 --- a/src/types/array.rs +++ b/src/types/array.rs @@ -51,9 +51,9 @@ impl ShaderType for [T; N] { " (current stride: ", Self::METADATA.stride().get(), ")" - ) + ); }, - ]) + ]); }; } diff --git a/tests/assert_uniform_compat_fail.rs b/tests/assert_uniform_compat_fail.rs index 151e6ee..9bc0c96 100644 --- a/tests/assert_uniform_compat_fail.rs +++ b/tests/assert_uniform_compat_fail.rs @@ -20,7 +20,7 @@ fn test_struct() { b: S, } - TestStruct::assert_uniform_compat() + TestStruct::assert_uniform_compat(); } #[test] @@ -32,7 +32,7 @@ fn test_array() { b: [WrappedF32; 1], } - TestArray::assert_uniform_compat() + TestArray::assert_uniform_compat(); } #[test] @@ -44,7 +44,7 @@ fn test_struct_first() { b: f32, } - TestStructFirst::assert_uniform_compat() + TestStructFirst::assert_uniform_compat(); } #[test] @@ -55,7 +55,7 @@ fn test_array_stride() { a: [u32; 8], } - TestArrayStride::assert_uniform_compat() + TestArrayStride::assert_uniform_compat(); } #[test] @@ -67,5 +67,5 @@ fn test_rts_array() { a: Vec, } - TestRTSArray::assert_uniform_compat() + TestRTSArray::assert_uniform_compat(); }