Skip to content

Commit

Permalink
clippy: resolve build errors for Rust 1.79
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
eugkoira committed Jun 25, 2024
1 parent 04f48e0 commit fe8efd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/common/commands_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ fn parse_enclave_cid(args: &ArgMatches) -> NitroCliResult<Option<u64>> {
));
}

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",
Expand All @@ -425,7 +425,7 @@ fn parse_enclave_cid(args: &ArgMatches) -> NitroCliResult<Option<u64>> {
}

// 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",
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe8efd4

Please sign in to comment.