-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomers
Description
Add documentation to the methods generated for the MemorySize methods generated here:
Lines 9 to 33 in 72e36c4
| macro_rules! impl_memsz { | |
| ($from_fn: ident => $param: ident * $expr: expr) => { | |
| #[inline] | |
| pub fn $from_fn($param: u64) -> Self { | |
| Self($param * $expr) | |
| } | |
| #[inline] | |
| pub fn $param(self) -> u64 { | |
| self.0 / $expr | |
| } | |
| }; | |
| } | |
| impl MemorySize { | |
| impl_memsz!(from_bytes => bytes * 1); | |
| impl_memsz!(from_kb => kilobytes * 1000); | |
| impl_memsz!(from_mb => megabytes * 1000 * 1000); | |
| impl_memsz!(from_gb => gigabytes * 1000 * 1000 * 1000); | |
| impl_memsz!(from_kib => kibibytes * 1024); | |
| impl_memsz!(from_mib => mebibytes * 1024 * 1024); | |
| impl_memsz!(from_gib => gibibytes * 1024 * 1024 * 1024); | |
| } |
The documentation should specifically cover the math used (1024 vs 1000)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomers