Skip to content

Commit

Permalink
optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Jul 19, 2024
1 parent ed808e6 commit 9166faa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cfdp/pdu/file_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,16 @@ impl FileDataPduCreatorWithUnwrittenData<'_> {
}

/// This functio needs to be called to add a CRC to the file data PDU where applicable.
pub fn finish(self) {
///
/// It returns the full written size of the PDU.
pub fn finish(self) -> usize {
if self.needs_crc {
add_pdu_crc(
self.write_buf,
self.file_data_offset as usize + self.file_data_len as usize,
);
}
self.write_buf.len()
}
}

Expand Down

0 comments on commit 9166faa

Please sign in to comment.