mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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:
committed by
Steffen Eiden
parent
784cff18c3
commit
5b8fdc2bec
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user