Skip to content

Commit

Permalink
attest-data: fix Array<N>::try_from(Vec<u8>)
Browse files Browse the repository at this point in the history
Turn Vec into a slice / [u8] before attempting to convert it into an
Array<N>. This prevents a call loop.
  • Loading branch information
flihp committed Dec 23, 2023
1 parent 785ee6d commit da1df40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion attest-data/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<const N: usize> TryFrom<Vec<u8>> for Array<N> {

/// Attempt to create an Array<N> from the Vec<u8> provided.
fn try_from(item: Vec<u8>) -> Result<Self, Self::Error> {
item.try_into()
item[..].try_into()
}
}

Expand Down

0 comments on commit da1df40

Please sign in to comment.