]> git.nega.tv - josh/narcissus/commitdiff
Fix clippy lints
authorJoshua Simmons <josh@nega.tv>
Thu, 3 Nov 2022 21:51:42 +0000 (22:51 +0100)
committerJoshua Simmons <josh@nega.tv>
Thu, 3 Nov 2022 21:57:43 +0000 (22:57 +0100)
narcissus-core/src/arena.rs

index d25826e85dc87a6248f2d0ef020babb194e73bc5..18e882e31cea5bc99fa279f444af0be588701aaf 100644 (file)
@@ -266,6 +266,7 @@ impl Arena {
     }
 
     #[inline(always)]
+    #[allow(clippy::mut_from_ref)]
     pub fn alloc<T>(&self, value: T) -> &mut T {
         // Safety: We allocate memory for `T` and then write a `T` into that location.
         unsafe {
@@ -278,6 +279,7 @@ impl Arena {
     }
 
     #[inline(always)]
+    #[allow(clippy::mut_from_ref)]
     pub fn alloc_with<T, F>(&self, f: F) -> &mut T
     where
         F: FnOnce() -> T,
@@ -293,6 +295,7 @@ impl Arena {
     }
 
     #[inline(always)]
+    #[allow(clippy::mut_from_ref)]
     pub fn try_alloc_with<T, F>(&self, f: F) -> Result<&mut T, AllocError>
     where
         F: FnOnce() -> T,
@@ -492,6 +495,7 @@ impl<const STACK_CAP: usize> HybridArena<STACK_CAP> {
     }
 
     #[inline(always)]
+    #[allow(clippy::mut_from_ref)]
     pub fn alloc<T>(&self, value: T) -> &mut T {
         // Safety: We allocate memory for `T` and then write a `T` into that location.
         unsafe {
@@ -504,6 +508,7 @@ impl<const STACK_CAP: usize> HybridArena<STACK_CAP> {
     }
 
     #[inline(always)]
+    #[allow(clippy::mut_from_ref)]
     pub fn alloc_with<T, F>(&self, f: F) -> &mut T
     where
         F: FnOnce() -> T,
@@ -519,6 +524,7 @@ impl<const STACK_CAP: usize> HybridArena<STACK_CAP> {
     }
 
     #[inline(always)]
+    #[allow(clippy::mut_from_ref)]
     pub fn try_alloc_with<T, F>(&self, f: F) -> Result<&mut T, AllocError>
     where
         F: FnOnce() -> T,