mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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:
committed by
Steffen Eiden
parent
2155b83c1f
commit
667a8d714b
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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)?;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user