weight: Make docs uniform and terse

Make the docs use the same form as everywhere else, which also mimics
stdlib docs on integer types.
This commit is contained in:
Tobin C. Harding 2023-07-20 09:32:23 +10:00
parent 63a09649f7
commit f3412325ea
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 1 additions and 5 deletions

View File

@ -43,11 +43,7 @@ impl Weight {
/// Constructs `Weight` from kilo weight units returning `None` if overflow occurred. /// Constructs `Weight` from kilo weight units returning `None` if overflow occurred.
pub fn from_kwu(wu: u64) -> Option<Self> { wu.checked_mul(1000).map(Weight) } pub fn from_kwu(wu: u64) -> Option<Self> { wu.checked_mul(1000).map(Weight) }
/// Constructs `Weight` from virtual bytes. /// Constructs `Weight` from virtual bytes, returning `None` on overflow.
///
/// # Errors
///
/// Returns `None` on overflow.
pub fn from_vb(vb: u64) -> Option<Self> { vb.checked_mul(4).map(Weight::from_wu) } pub fn from_vb(vb: u64) -> Option<Self> { vb.checked_mul(4).map(Weight::from_wu) }
/// Constructs `Weight` from virtual bytes without overflow check. /// Constructs `Weight` from virtual bytes without overflow check.