From fe8efd4121a9fdadb611d6df2fa3adf79870ceb0 Mon Sep 17 00:00:00 2001 From: Eugene Koira Date: Tue, 25 Jun 2024 10:09:18 +0000 Subject: [PATCH] clippy: resolve build errors for Rust 1.79 Resolving clippy error when building with Rust 1.79: https://rust-lang.github.io/rust-clippy/master/index.html#/legacy_numeric_constants Signed-off-by: Eugene Koira --- src/common/commands_parser.rs | 4 ++-- src/utils.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/commands_parser.rs b/src/common/commands_parser.rs index 0da9a7a1b..780091964 100644 --- a/src/common/commands_parser.rs +++ b/src/common/commands_parser.rs @@ -403,7 +403,7 @@ fn parse_enclave_cid(args: &ArgMatches) -> NitroCliResult> { )); } - if enclave_cid == u32::max_value() as u64 { + if enclave_cid == u32::MAX as u64 { return Err(new_nitro_cli_failure!( &format!( "CID {} is a well-known CID, not to be used for enclaves", @@ -425,7 +425,7 @@ fn parse_enclave_cid(args: &ArgMatches) -> NitroCliResult> { } // 64-bit CIDs are not yet supported for the vsock device. - if enclave_cid > u32::max_value() as u64 { + if enclave_cid > u32::MAX as u64 { return Err(new_nitro_cli_failure!( &format!( "CID {} is higher than the maximum supported (u32 max) for a vsock device", diff --git a/src/utils.rs b/src/utils.rs index bc368f5c1..7fef629d6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -321,7 +321,7 @@ fn vsock_set_connect_timeout(fd: RawFd, millis: i64) -> NitroCliResult<()> { /// limit of enclave memory based on the EIF file size. pub fn ceil_div(lhs: u64, rhs: u64) -> u64 { if rhs == 0 { - return std::u64::MAX; + return u64::MAX; } lhs / rhs