From 19c9be3ea8a0bce9b3ca8f5c06e6003b720f2b91 Mon Sep 17 00:00:00 2001 From: Alexandru Ciobotaru Date: Thu, 22 Dec 2022 10:41:08 +0200 Subject: [PATCH] clippy: fix minor issue error: the borrowed expression implements the required traits --> enclave_build/src/docker.rs:101:50 | 101 | let decoded = base64::decode(&auth).map_err(|err| { | ^^^^^ help: change this to: `auth` | = note: `-D clippy::needless-borrow` implied by `-D warnings` Signed-off-by: Alexandru Ciobotaru --- enclave_build/src/docker.rs | 2 +- src/utils.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/enclave_build/src/docker.rs b/enclave_build/src/docker.rs index 25370138..161c9f7d 100644 --- a/enclave_build/src/docker.rs +++ b/enclave_build/src/docker.rs @@ -98,7 +98,7 @@ impl DockerUtil { .to_string(); let auth = auth.replace('"', ""); - let decoded = base64::decode(&auth).map_err(|err| { + let decoded = base64::decode(auth).map_err(|err| { CredentialsError(format!("Invalid Base64 encoding for auth: {}", err)) })?; let decoded = std::str::from_utf8(&decoded).map_err(|err| { diff --git a/src/utils.rs b/src/utils.rs index 98d9e29e..dd17ebf4 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -297,7 +297,7 @@ fn vsock_set_connect_timeout(fd: RawFd, millis: i64) -> NitroCliResult<()> { let timeval = TimeVal::milliseconds(millis); let ret = unsafe { libc::setsockopt( - fd as i32, + fd, libc::AF_VSOCK, SO_VM_SOCKETS_CONNECT_TIMEOUT, &timeval as *const _ as *const c_void,