Use fully qualified syntax in assertions. (#17936)

# Objective

Fix #17924 

## Solution

Use fully qualified syntax (`usize::from` rather than `.into()`).

## Testing

Ran a build for the platform specified in the issue.

---------

Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
This commit is contained in:
DragonGamesStudios 2025-02-22 02:58:54 +01:00 committed by GitHub
parent 63e0f794d1
commit a7cb061d6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -256,7 +256,7 @@ impl BlobArray {
new_capacity: NonZeroUsize,
) {
#[cfg(debug_assertions)]
debug_assert_eq!(self.capacity, current_capacity.into());
debug_assert_eq!(self.capacity, current_capacity.get());
if !self.is_zst() {
// SAFETY: `new_capacity` can't overflow usize
let new_layout =

View File

@ -87,7 +87,7 @@ impl<T> ThinArrayPtr<T> {
/// - The caller should update their saved `capacity` value to reflect the fact that it was changed
pub unsafe fn realloc(&mut self, current_capacity: NonZeroUsize, new_capacity: NonZeroUsize) {
#[cfg(debug_assertions)]
assert_eq!(self.capacity, current_capacity.into());
assert_eq!(self.capacity, current_capacity.get());
self.set_capacity(new_capacity.get());
if size_of::<T>() != 0 {
let new_layout =