rust: Fix cargo clippy and cargo doc findings

Fix the new `cargo clippy` and `cargo doc` findings that were triggered
with the recent policy addition.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-11-11 14:09:17 +00:00
committed by Steffen Eiden
parent 2155b83c1f
commit 667a8d714b
15 changed files with 20 additions and 20 deletions
+2 -3
View File
@@ -152,9 +152,8 @@ impl AttestationCmd {
/// If called before a successful attestation the data in this buffer is undefined.
pub fn additional(&mut self) -> Option<&[u8]> {
// truncate the add size to the UV reported size
match &mut self.additional {
Some(ref mut a) => a.truncate(self.uvio_attest.add_data_len as usize),
None => (),
if let Some(ref mut a) = &mut self.additional {
a.truncate(self.uvio_attest.add_data_len as usize)
}
self.additional.as_deref()
}
+2 -2
View File
@@ -53,8 +53,8 @@ impl AddCmd {
///
/// # Errors
///
/// This function will return an error if the provided data does not start with the
/// [`crate::AddSecretRequest`] magic Value.
/// This function will return an error if the provided data does not start
/// with the `AddSecretRequest` magic Value.
pub fn new<R: Read>(bin_add_secret_req: &mut R) -> Result<Self> {
let mut data = Vec::with_capacity(PAGESIZE);
bin_add_secret_req.read_to_end(&mut data)?;
+1 -1
View File
@@ -337,7 +337,7 @@ where
{
struct FieldVisitor;
impl<'de> serde::de::Visitor<'de> for FieldVisitor {
impl serde::de::Visitor<'_> for FieldVisitor {
type Value = [u8; SecretId::ID_SIZE];
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
+1 -1
View File
@@ -11,7 +11,7 @@ use byteorder::{BigEndian, ByteOrder};
use std::{fmt::Display, mem::size_of};
use zerocopy::{AsBytes, U16};
/// The magic value used to identify an [`crate:AddSecretRequest`]
/// The magic value used to identify an `AddSecretRequest`.
///
/// The magic value is ASCII:
/// ```rust