Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy: resolve build errors for Rust 1.79 #630

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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