Skip to content

Commit

Permalink
📝 clarify documentation for structure size representation
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanTsune committed Dec 22, 2024
1 parent a63e6a2 commit c47cc73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ use std::{
ops::Deref,
};

/// Minimum required size of bytes to represent [`Chunk`].
/// length:4 + chunk type:4 + data:0 + crc:4
/// Minimum required size in bytes to represent [`Chunk`].
/// length: 4 bytes + chunk type: 4 bytes + data: 0 bytes + crc: 4 bytes
pub const MIN_CHUNK_BYTES_SIZE: usize =
mem::size_of::<u32>() + mem::size_of::<ChunkType>() + mem::size_of::<u32>();

pub(crate) trait ChunkExt: Chunk {
/// byte size of chunk
/// size of chunk in bytes
#[inline]
fn bytes_len(&self) -> usize {
MIN_CHUNK_BYTES_SIZE + self.data().len()
Expand Down
4 changes: 2 additions & 2 deletions lib/src/entry/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ impl Metadata {
self
}

/// Raw file size of entry data
/// Raw file size of entry data in bytes
#[inline]
pub const fn raw_file_size(&self) -> Option<u128> {
self.raw_file_size
}
/// Compressed size of entry data
/// Compressed size of entry data in bytes
#[inline]
pub const fn compressed_size(&self) -> usize {
self.compressed_size
Expand Down

0 comments on commit c47cc73

Please sign in to comment.