pv: Improve API by marking some functions as must_use

Make the API less prone to error by specifying some of them as must_use.
This avoids issues that the result is not used.

Signed-off-by: Marc Hartmayer <marc@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
2026-06-26 16:08:42 +02:00
committed by Steffen Eiden
parent 784cff18c3
commit 5b8fdc2bec
2 changed files with 3 additions and 0 deletions

View File

@@ -119,6 +119,7 @@ impl SymKeyType {
}
/// Returns true if the [`SymKeyType`] is an AEAD key
#[must_use]
pub const fn is_aead(&self) -> bool {
self.tag_len().is_some()
}

View File

@@ -182,6 +182,7 @@ impl Keyslot {
}
/// Return the public host key hash size for the given version of the key-slot in bytes
#[must_use]
pub fn phkh_size(&self) -> u32 {
match self {
Keyslot::V1(_) => KeyslotV1::PHKH_SIZE,
@@ -190,6 +191,7 @@ impl Keyslot {
}
/// Return the size of the key-slot in bytes
#[must_use]
pub fn size(&self) -> usize {
match self {
Keyslot::V1(_) => KeyslotV1::SIZE,