Skip to content

Commit

Permalink
Fix clippy warning about unnecessary cast
Browse files Browse the repository at this point in the history
  • Loading branch information
1c3t3a committed Jul 31, 2024
1 parent 4bd8479 commit a7ff3af
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scudo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.
#![no_std]
#![cfg_attr(feature = "allocator_api", feature(allocator_api))]
#![cfg_attr(feature = "allocator_api", feature(nonnull_slice_from_raw_parts))]
#[cfg(test)]
#[macro_use]
extern crate std;
Expand All @@ -30,7 +29,7 @@ pub struct GlobalScudoAllocator;
/// Returns `layout` or the minimum size/align layout for scudo if its too small.
fn fit_layout(layout: Layout) -> Layout {
// SAFETY: SCUDO_MIN_ALIGN is constant and known to be powers of 2.
let min_align = unsafe { SCUDO_MIN_ALIGN } as usize;
let min_align = unsafe { SCUDO_MIN_ALIGN };
let align = max(min_align, layout.align());
// SAFETY: Size and align are good by construction.
unsafe { Layout::from_size_align_unchecked(layout.size(), align) }
Expand Down

0 comments on commit a7ff3af

Please sign in to comment.