Skip to content

Commit 71a241e

Browse files
committed
feat: document size() methods
1 parent bde855c commit 71a241e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

crates/league-modpkg/src/license.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub enum ModpkgLicense {
2828
}
2929

3030
impl ModpkgLicense {
31+
/// The total size of the license when written to bytes.
3132
#[inline]
3233
pub fn size(&self) -> usize {
3334
1 + match self {

crates/league-modpkg/src/metadata.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub struct ModpkgMetadata {
5858
}
5959

6060
impl ModpkgMetadata {
61+
/// The total size of the metadata when written to bytes.
6162
pub fn size(&self) -> usize {
6263
(self.name.len() + size_of::<u32>())
6364
+ (self.display_name.len() + size_of::<u32>())
@@ -125,6 +126,7 @@ impl ModpkgAuthor {
125126
}
126127

127128
impl ModpkgAuthor {
129+
/// The total size of the author when written to bytes.
128130
pub fn size(&self) -> usize {
129131
(self.name.len() + size_of::<u32>()) + (optional_string_len(&self.role) + size_of::<u32>())
130132
}

0 commit comments

Comments
 (0)