mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-18 17:33:02 +00:00
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:
parent
225c7fc026
commit
1d9efeb92b
@ -1653,7 +1653,6 @@ mod tests {
|
|||||||
result: Result<VmConfig, VmConfigError>,
|
result: Result<VmConfig, VmConfigError>,
|
||||||
}
|
}
|
||||||
|
|
||||||
let u8_max = std::u8::MAX;
|
|
||||||
let sysinfo = nix::sys::sysinfo::sysinfo().unwrap();
|
let sysinfo = nix::sys::sysinfo::sysinfo().unwrap();
|
||||||
|
|
||||||
let actual_max_mem_bytes = sysinfo.ram_total();
|
let actual_max_mem_bytes = sysinfo.ram_total();
|
||||||
@ -1679,8 +1678,8 @@ mod tests {
|
|||||||
let valid_vsock =
|
let valid_vsock =
|
||||||
VsockConfig::try_from((vsock_socket_path.to_string(), DEFAULT_VSOCK_CID)).unwrap();
|
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, 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_tdx, cpus_config_tdx) = make_cpu_objects(7, u8::MAX, true);
|
||||||
|
|
||||||
let (memory_info_std, mem_config_std) =
|
let (memory_info_std, mem_config_std) =
|
||||||
make_memory_objects(79, usable_max_mem_bytes, false);
|
make_memory_objects(79, usable_max_mem_bytes, false);
|
||||||
|
@ -138,7 +138,7 @@ mod tests {
|
|||||||
assert!(do_decrease_count(ref_count_3).unwrap());
|
assert!(do_decrease_count(ref_count_3).unwrap());
|
||||||
|
|
||||||
// Third, ref_count is MAX
|
// 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;
|
let ref_count_max: &mut u64 = &mut max_count;
|
||||||
assert!(do_increase_count(ref_count_max).is_err());
|
assert!(do_increase_count(ref_count_max).is_err());
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// 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 anyhow::{anyhow, Context, Result};
|
||||||
use futures::stream::TryStreamExt;
|
use futures::stream::TryStreamExt;
|
||||||
|
Loading…
Reference in New Issue
Block a user