mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
rust/pv: Use a SecretId struct instead of an array
This streamlines and unifies the use and (de)serialization of structs using a secret id. As a bonus, the hidden `for_pv` module is not longer needed. Signed-off-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Julian Ruess <julianr@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
81a1e13f3b
commit
c53dfa9754
@@ -528,8 +528,8 @@ mod tests {
|
||||
fn make_assoc_secretentry(idx: u16, hexidstr: &str) -> SecretEntry {
|
||||
let id = hexstring_to_u8(hexidstr);
|
||||
let idlen: u32 = id.len().try_into().unwrap();
|
||||
let idarray = <&[u8; 32]>::try_from(id.as_slice()).unwrap();
|
||||
SecretEntry::new(idx, ListableSecretType::Association, *idarray, idlen)
|
||||
let idarray: [u8; 32] = id.try_into().unwrap();
|
||||
SecretEntry::new(idx, ListableSecretType::Association, idarray.into(), idlen)
|
||||
}
|
||||
|
||||
fn make_test_secrets() -> Vec<SecretEntry> {
|
||||
|
||||
Reference in New Issue
Block a user