Update Android for Rust 1.83.0
* Unnecessary return
* Unnecessary lifetime
* Use `.div_ceil()`
Test: m rust
Bug: 384401387
Change-Id: I7139ff204d35d179cf41b1b26aab5530f7041b39
diff --git a/libs/libvm_payload/src/lib.rs b/libs/libvm_payload/src/lib.rs
index cbadec2..14aff99 100644
--- a/libs/libvm_payload/src/lib.rs
+++ b/libs/libvm_payload/src/lib.rs
@@ -27,7 +27,7 @@
use rpcbinder::{RpcServer, RpcSession};
use openssl::{ec::EcKey, sha::sha256, ecdsa::EcdsaSig};
use std::convert::Infallible;
-use std::ffi::{CString, CStr};
+use std::ffi::CString;
use std::fmt::Debug;
use std::os::raw::{c_char, c_void};
use std::path::Path;
@@ -376,20 +376,16 @@
#[no_mangle]
pub extern "C" fn AVmAttestationStatus_toString(status: AVmAttestationStatus) -> *const c_char {
let message = match status {
- AVmAttestationStatus::ATTESTATION_OK => {
- CStr::from_bytes_with_nul(b"The remote attestation completes successfully.\0").unwrap()
- }
+ AVmAttestationStatus::ATTESTATION_OK => c"The remote attestation completes successfully.",
AVmAttestationStatus::ATTESTATION_ERROR_INVALID_CHALLENGE => {
- CStr::from_bytes_with_nul(b"The challenge size is not between 0 and 64.\0").unwrap()
+ c"The challenge size is not between 0 and 64."
}
AVmAttestationStatus::ATTESTATION_ERROR_ATTESTATION_FAILED => {
- CStr::from_bytes_with_nul(b"Failed to attest the VM. Please retry at a later time.\0")
- .unwrap()
+ c"Failed to attest the VM. Please retry at a later time."
}
- AVmAttestationStatus::ATTESTATION_ERROR_UNSUPPORTED => CStr::from_bytes_with_nul(
- b"Remote attestation is not supported in the current environment.\0",
- )
- .unwrap(),
+ AVmAttestationStatus::ATTESTATION_ERROR_UNSUPPORTED => {
+ c"Remote attestation is not supported in the current environment."
+ }
};
message.as_ptr()
}