Skip to content

Commit

Permalink
Merge pull request 'Add back API which was deleted accidently' (#116)…
Browse files Browse the repository at this point in the history
… from add-back-api into main

Reviewed-on: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/116
  • Loading branch information
robamu committed Nov 8, 2024
2 parents d58df5f + 05d3bac commit 2d7ccc0
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 2d7ccc0

Please sign in to comment.