Skip to content

Commit

Permalink
clippy: Fix semicolon_if_nothing_returned lints.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Mar 24, 2024
1 parent 6d34824 commit 60c2d01
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions benches/throughput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<A>>().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,
)
);
});
}

Expand Down
10 changes: 5 additions & 5 deletions src/core/rw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ impl<B: BufferMut> Writer<B> {

#[inline]
pub fn advance(&mut self, amount: usize) {
self.cursor.advance(amount)
self.cursor.advance(amount);
}

#[inline]
pub fn write<const N: usize>(&mut self, val: &[u8; N]) {
self.cursor.write(val)
self.cursor.write(val);
}
}

Expand Down Expand Up @@ -85,7 +85,7 @@ impl<B: BufferRef> Reader<B> {

#[inline]
pub fn advance(&mut self, amount: usize) {
self.cursor.advance(amount)
self.cursor.advance(amount);
}

#[inline]
Expand Down Expand Up @@ -239,7 +239,7 @@ impl<const LEN: usize> BufferMut for [u8; LEN] {

#[inline]
fn write<const N: usize>(&mut self, offset: usize, val: &[u8; N]) {
<[u8] as BufferMut>::write(self, offset, val)
<[u8] as BufferMut>::write(self, offset, val);
}
}

Expand All @@ -251,7 +251,7 @@ impl BufferMut for Vec<u8> {

#[inline]
fn write<const N: usize>(&mut self, offset: usize, val: &[u8; N]) {
<[u8] as BufferMut>::write(self, offset, val)
<[u8] as BufferMut>::write(self, offset, val);
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/core/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/types/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ impl<T: ShaderType + ShaderSize, const N: usize> ShaderType for [T; N] {
" (current stride: ",
Self::METADATA.stride().get(),
")"
)
);
},
])
]);
};
}

Expand Down
10 changes: 5 additions & 5 deletions tests/assert_uniform_compat_fail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn test_struct() {
b: S,
}

TestStruct::assert_uniform_compat()
TestStruct::assert_uniform_compat();
}

#[test]
Expand All @@ -32,7 +32,7 @@ fn test_array() {
b: [WrappedF32; 1],
}

TestArray::assert_uniform_compat()
TestArray::assert_uniform_compat();
}

#[test]
Expand All @@ -44,7 +44,7 @@ fn test_struct_first() {
b: f32,
}

TestStructFirst::assert_uniform_compat()
TestStructFirst::assert_uniform_compat();
}

#[test]
Expand All @@ -55,7 +55,7 @@ fn test_array_stride() {
a: [u32; 8],
}

TestArrayStride::assert_uniform_compat()
TestArrayStride::assert_uniform_compat();
}

#[test]
Expand All @@ -67,5 +67,5 @@ fn test_rts_array() {
a: Vec<f32>,
}

TestRTSArray::assert_uniform_compat()
TestRTSArray::assert_uniform_compat();
}

0 comments on commit 60c2d01

Please sign in to comment.