use usize::MAX instead of !0

This commit is contained in:
Mark Mansi 2019-11-25 18:14:46 -06:00
parent 3ec3fca414
commit baaf864e07
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ impl<T, A: Alloc> RawVec<T, A> {
pub const fn new_in(a: A) -> Self { pub const fn new_in(a: A) -> Self {
let cap = { let cap = {
#[cfg(not(bootstrap))] #[cfg(not(bootstrap))]
{ if mem::size_of::<T>() == 0 { !0 } else { 0 } } { if mem::size_of::<T>() == 0 { usize::MAX } else { 0 } }
#[cfg(bootstrap)] #[cfg(bootstrap)]
[0, !0][(mem::size_of::<T>() == 0) as usize] [0, !0][(mem::size_of::<T>() == 0) as usize]