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:
parent
63e0f794d1
commit
a7cb061d6c
@ -256,7 +256,7 @@ impl BlobArray {
|
|||||||
new_capacity: NonZeroUsize,
|
new_capacity: NonZeroUsize,
|
||||||
) {
|
) {
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
debug_assert_eq!(self.capacity, current_capacity.into());
|
debug_assert_eq!(self.capacity, current_capacity.get());
|
||||||
if !self.is_zst() {
|
if !self.is_zst() {
|
||||||
// SAFETY: `new_capacity` can't overflow usize
|
// SAFETY: `new_capacity` can't overflow usize
|
||||||
let new_layout =
|
let new_layout =
|
||||||
|
@ -87,7 +87,7 @@ impl<T> ThinArrayPtr<T> {
|
|||||||
/// - The caller should update their saved `capacity` value to reflect the fact that it was changed
|
/// - 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) {
|
pub unsafe fn realloc(&mut self, current_capacity: NonZeroUsize, new_capacity: NonZeroUsize) {
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
assert_eq!(self.capacity, current_capacity.into());
|
assert_eq!(self.capacity, current_capacity.get());
|
||||||
self.set_capacity(new_capacity.get());
|
self.set_capacity(new_capacity.get());
|
||||||
if size_of::<T>() != 0 {
|
if size_of::<T>() != 0 {
|
||||||
let new_layout =
|
let new_layout =
|
||||||
|
Loading…
Reference in New Issue
Block a user