Rename from_components to from_parts (#12473)

* Rename `from_components` to `from_parts`

* Fixes

* Spelling
This commit is contained in:
Keith Yeung
2022-10-12 00:35:54 +08:00
committed by GitHub
parent e1e5b7037a
commit fbdfa84cd7
4 changed files with 7 additions and 7 deletions
@@ -112,8 +112,8 @@ impl Weight {
Self { ref_time: 0, proof_size }
}
/// Construct [`Weight`] with weight components, namely reference time and storage size weights.
pub const fn from_components(ref_time: u64, proof_size: u64) -> Self {
/// Construct [`Weight`] from weight parts, namely reference time and proof size weights.
pub const fn from_parts(ref_time: u64, proof_size: u64) -> Self {
Self { ref_time, proof_size }
}
@@ -455,8 +455,8 @@ mod tests {
#[test]
fn is_zero_works() {
assert!(Weight::zero().is_zero());
assert!(!Weight::from_components(1, 0).is_zero());
assert!(!Weight::from_components(0, 1).is_zero());
assert!(!Weight::from_parts(1, 0).is_zero());
assert!(!Weight::from_parts(0, 1).is_zero());
assert!(!Weight::MAX.is_zero());
}
}