Skip to content

Commit

Permalink
clippy: resolve build errors for Rust 1.79
Browse files Browse the repository at this point in the history
  • Loading branch information
eugkoira committed Jun 25, 2024
1 parent 04f48e0 commit 1b85ec1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions samples/command_executer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,7 @@ pub fn run(args: RunArgs) -> Result<i32, String> {
print!("{}", output.stdout);
eprint!("{}", output.stderr);

let rc = match output.rc {
Some(code) => code,
_ => 0,
};

Ok(rc)
Ok(output.rc.unwrap_or_default())
}

pub fn recv_file(args: FileArgs) -> Result<(), String> {
Expand Down
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 1b85ec1

Please sign in to comment.