Remove alloc for extensions
This commit is contained in:
parent
0904b73c12
commit
94a8343be7
2 changed files with 4 additions and 4 deletions
|
@ -7,7 +7,7 @@ pub enum Version {
|
|||
V1 = 0
|
||||
}
|
||||
|
||||
pub type CtExtensions = Vec<u8>;
|
||||
pub type CtExtensions<'a> = &'a [u8];
|
||||
|
||||
#[repr(u8)]
|
||||
#[non_exhaustive]
|
||||
|
@ -16,7 +16,7 @@ pub enum MerkleLeafType<'a> {
|
|||
TimeStampedEntry {
|
||||
timestamp: u64,
|
||||
entry_type: LogEntryType<'a>,
|
||||
extensions: CtExtensions
|
||||
extensions: CtExtensions<'a>
|
||||
} = 0
|
||||
}
|
||||
|
||||
|
|
|
@ -95,14 +95,14 @@ pub fn parse_merkle_tree_leaf(
|
|||
|
||||
let (
|
||||
_, // no more to parse
|
||||
ct_extensions // opaque CtExtensions<0..2^16-1>
|
||||
extensions // opaque CtExtensions<0..2^16-1>
|
||||
) = nom::multi::length_data(nom::number::complete::be_u16)(input)
|
||||
.map_err(|e| e.map(|e| LeafParsingError::Nom(e)))?;
|
||||
|
||||
MerkleLeafType::TimeStampedEntry {
|
||||
timestamp,
|
||||
entry_type,
|
||||
extensions: ct_extensions.to_vec()
|
||||
extensions
|
||||
}
|
||||
}
|
||||
_ =>
|
||||
|
|
Loading…
Reference in a new issue