added missing alloc feature gate
Rust/spacepackets/pipeline/head There was a failure building this commit Details
Rust/spacepackets/pipeline/pr-main There was a failure building this commit Details

This commit is contained in:
Robin Müller 2023-12-06 17:07:28 +01:00
parent 90cca0fd9e
commit 28e9dd9b29
Signed by: muellerr
GPG Key ID: A649FB78196E3849
1 changed files with 1 additions and 0 deletions

View File

@ -42,6 +42,7 @@ pub trait GenericTlv {
pub trait WritableTlv {
fn write_to_bytes(&self, buf: &mut [u8]) -> Result<usize, ByteConversionError>;
fn len_written(&self) -> usize;
#[cfg(feautre = "alloc")]
fn to_vec(&self) -> Vec<u8> {
let mut buf = vec![0; self.len_written()];
self.write_to_bytes(&mut buf).unwrap();