sdk: Use u32::MAX from std to unbreak BPF builds (#16171)

This commit is contained in:
Justin Starry 2021-03-27 23:53:25 +08:00 committed by GitHub
parent 16e4ccca13
commit aabe186e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -99,9 +99,9 @@ fn visit_byte(elem: u8, val: u16, nth_byte: usize) -> VisitResult {
}
let shift = u32::try_from(nth_byte)
.unwrap_or(u32::MAX)
.unwrap_or(std::u32::MAX)
.saturating_mul(7);
let elem_val = elem_val.checked_shl(shift).unwrap_or(u32::MAX);
let elem_val = elem_val.checked_shl(shift).unwrap_or(std::u32::MAX);
let new_val = val | elem_val;
let val = u16::try_from(new_val).map_err(|_| VisitError::Overflow(new_val))?;