iread_n_const: unwrap->expect

This commit is contained in:
AF 2023-06-28 16:39:18 +00:00
parent 8558b8d1ba
commit cb56595d45

View File

@ -26,7 +26,11 @@ pub trait InliningExt<E>: Inlining {
self, self,
err: impl FnOnce(&[u8]) -> E, err: impl FnOnce(&[u8]) -> E,
) -> Result<([u8; N], Self), E> { ) -> Result<([u8; N], Self), E> {
self.iread_n(N, |slice| slice.try_into().unwrap(), err) self.iread_n(
N,
|slice| slice.try_into().expect("iread_n wrong length."),
err,
)
} }
} }