rust/pv_core: Fix the argument order in 'LengthMismatch'

Fix the ordering of the parameters in 'TryFrom<Confidential<Vec<u8> for
Confidential<[u8; N>'. While at it, convert 'LengthMismatch' error to a
named struct.

Fixes: 7608cf2de4 ("rust/confidential: Add `From` and `Into` for confidential byes arrays/vectors")
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-11-28 17:04:11 +01:00
committed by Jan Höppner
parent 24e285ce02
commit 8c23e09a60
3 changed files with 17 additions and 5 deletions
+2 -2
View File
@@ -82,8 +82,8 @@ pub enum Error {
#[error("Cannot decode hex string")]
InvHexStringChar { source: std::num::ParseIntError },
#[error("Expected size {0}, found {1}")]
LengthMismatch(usize, usize),
#[error("Expected size {expected}, actual {actual}")]
LengthMismatch { expected: usize, actual: usize },
}
/// Error cases for I/O operations