From ca48a7b56f55eceb6eb0e606a78a9f562c985621 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 25 Sep 2023 21:11:31 +0700 Subject: [PATCH] clippy: Use semicolon when not returning a value. --- src/lib.rs | 8 ++++---- tests/try_alloc.rs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a173321..fb1fe26 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -580,7 +580,7 @@ impl Bump { /// assert!(bump.try_alloc(5).is_err()); /// ``` pub fn set_allocation_limit(&self, limit: Option) { - self.allocation_limit.set(limit) + self.allocation_limit.set(limit); } /// How much headroom an arena has before it hits its allocation @@ -857,7 +857,7 @@ impl Bump { // directly into the heap instead. It seems we get it to realize // this most consistently if we put this critical line into it's // own function instead of inlining it into the surrounding code. - ptr::write(ptr, f()) + ptr::write(ptr, f()); } let layout = Layout::new::(); @@ -910,7 +910,7 @@ impl Bump { // directly into the heap instead. It seems we get it to realize // this most consistently if we put this critical line into it's // own function instead of inlining it into the surrounding code. - ptr::write(ptr, f()) + ptr::write(ptr, f()); } //SAFETY: Self-contained: @@ -1862,7 +1862,7 @@ unsafe impl<'a> alloc::Alloc for &'a Bump { #[inline] unsafe fn dealloc(&mut self, ptr: NonNull, layout: Layout) { - Bump::dealloc(self, ptr, layout) + Bump::dealloc(self, ptr, layout); } #[inline] diff --git a/tests/try_alloc.rs b/tests/try_alloc.rs index 3be4ae8..f38aa5c 100644 --- a/tests/try_alloc.rs +++ b/tests/try_alloc.rs @@ -114,9 +114,9 @@ fn main() { GLOBAL_ALLOCATOR.set_returning_null(fail_alloc); if fail_alloc { - assert_alloc_err(&bump) + assert_alloc_err(&bump); } else { - assert_alloc_ok(&bump) + assert_alloc_ok(&bump); } } } @@ -169,7 +169,7 @@ fn main() { test_static_size_alloc( |bump| assert!(bump.try_alloc(1u8).is_ok()), |bump| assert!(bump.try_alloc(1u8).is_err()), - ) + ); }, ), test!( @@ -178,7 +178,7 @@ fn main() { test_static_size_alloc( |bump| assert!(bump.try_alloc_with(|| 1u8).is_ok()), |bump| assert!(bump.try_alloc_with(|| 1u8).is_err()), - ) + ); }, ), test!( @@ -187,7 +187,7 @@ fn main() { test_static_size_alloc( |bump| assert!(bump.try_alloc_try_with::<_, _, ()>(|| Ok(1u8)).is_ok()), |bump| assert!(bump.try_alloc_try_with::<_, _, ()>(|| Ok(1u8)).is_err()), - ) + ); }, ), test!( @@ -198,15 +198,15 @@ fn main() { assert!(matches!( bump.try_alloc_try_with::<_, u8, _>(|| Err(())), Err(AllocOrInitError::Init(_)) - )) + )); }, |bump| { assert!(matches!( bump.try_alloc_try_with::<_, u8, _>(|| Err(())), Err(AllocOrInitError::Alloc(_)) - )) + )); }, - ) + ); }, ), #[cfg(feature = "collections")]