Add documentation to the methods generated for the MemorySize methods generated here:
|
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)
Add documentation to the methods generated for the
MemorySizemethods generated here:leucite/src/prlimit.rs
Lines 9 to 33 in 72e36c4
The documentation should specifically cover the math used (1024 vs 1000)