runtime-rs: Remove use of legacy constants

Fix clippy error
```
error: usage of a legacy numeric constant
```
by swapping `std::u8::MAX` for `u8::MAX`

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman 2025-01-29 10:28:42 +00:00
parent 225c7fc026
commit 1d9efeb92b
3 changed files with 4 additions and 5 deletions

View File

@ -1653,7 +1653,6 @@ mod tests {
result: Result<VmConfig, VmConfigError>,
}
let u8_max = std::u8::MAX;
let sysinfo = nix::sys::sysinfo::sysinfo().unwrap();
let actual_max_mem_bytes = sysinfo.ram_total();
@ -1679,8 +1678,8 @@ mod tests {
let valid_vsock =
VsockConfig::try_from((vsock_socket_path.to_string(), DEFAULT_VSOCK_CID)).unwrap();
let (cpu_info, cpus_config) = make_cpu_objects(7, u8_max, false);
let (cpu_info_tdx, cpus_config_tdx) = make_cpu_objects(7, u8_max, true);
let (cpu_info, cpus_config) = make_cpu_objects(7, u8::MAX, false);
let (cpu_info_tdx, cpus_config_tdx) = make_cpu_objects(7, u8::MAX, true);
let (memory_info_std, mem_config_std) =
make_memory_objects(79, usable_max_mem_bytes, false);

View File

@ -138,7 +138,7 @@ mod tests {
assert!(do_decrease_count(ref_count_3).unwrap());
// Third, ref_count is MAX
let mut max_count = std::u64::MAX;
let mut max_count = u64::MAX;
let ref_count_max: &mut u64 = &mut max_count;
assert!(do_increase_count(ref_count_max).is_err());
}

View File

@ -4,7 +4,7 @@
// SPDX-License-Identifier: Apache-2.0
//
use std::{convert::TryFrom, sync::Arc, usize};
use std::{convert::TryFrom, sync::Arc};
use anyhow::{anyhow, Context, Result};
use futures::stream::TryStreamExt;