Skip to content

Commit

Permalink
Add back API which was deleted accidently
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Nov 8, 2024
1 parent d58df5f commit 05d3bac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/cfdp/tlv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ pub mod alloc_mod {
data: Vec::new(),
}
}

pub fn as_tlv(&self) -> Tlv<'_> {
Tlv {
tlv_type_field: self.tlv_type_field,
// The API should ensure that the data length is never to large, so the unwrap for the
// LV creation should never be an issue.
lv: Lv::new(&self.data).expect("lv creation failed unexpectedly"),
}
}
}

impl ReadableTlv for TlvOwned {
Expand Down

0 comments on commit 05d3bac

Please sign in to comment.