Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Salin authored and zakarumych committed Mar 3, 2024
1 parent f40bf6b commit faea97b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/arena/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl ArenaLocal {
}
None
}

#[inline(always)]
pub unsafe fn alloc_slow(
&self,
Expand Down
3 changes: 2 additions & 1 deletion src/arena/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ fn layout_sum(layout: &Layout) -> usize {
layout.size() + (layout.align() - 1)
}

pub trait CasPtr {
pub(crate) trait CasPtr {
#[allow(dead_code)]
fn new(value: *mut u8) -> Self;
fn load(&self, order: Ordering) -> *mut u8;
fn set(&mut self, value: *mut u8);
Expand Down
4 changes: 1 addition & 3 deletions src/blink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1442,9 +1442,7 @@ fn size_hint_and_one(lower: usize, upper: Option<usize>, count: usize) -> Option
let size_hint = lower.max(upper);

// Add one more element to size hint.
let Some(size_hint) = size_hint.checked_add(1) else {
return None;
};
let size_hint = size_hint.checked_add(1)?;

// Sum with current count.
count.checked_add(size_hint)
Expand Down
4 changes: 2 additions & 2 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ where
if let Some(ptr) = unsafe { self.arena.alloc_fast(layout) } {
return Ok(ptr);
}
unsafe { self.arena.alloc_slow(layout, &self.shared) }
unsafe { self.arena.alloc_slow(layout, self.shared) }
}

/// Resizes memory allocation.
Expand Down Expand Up @@ -510,7 +510,7 @@ where
// `ptr` was allocated by this allocator.
unsafe {
self.arena
.resize_slow(ptr, old_layout, new_layout, &self.shared)
.resize_slow(ptr, old_layout, new_layout, self.shared)
}
}

Expand Down

0 comments on commit faea97b

Please sign in to comment.