Use MAX associated const (#9196)

* Use MAX associated const
This commit is contained in:
Squirrel authored and GitHub committed 2021-06-24 11:53:49 +01:00
1 parent 09d9c2c9f6
commit ea1f21a904
56 files changed
+178 -178

No files matched your search

+1 -1
View File
@@ -179,7 +179,7 @@ fn speed<B: BlockT>(
// algebraic approach and we stay within the realm of integers.
let one_thousand = NumberFor::<B>::from(1_000u32);
let elapsed = NumberFor::<B>::from(
<u32 as TryFrom<_>>::try_from(elapsed_ms).unwrap_or(u32::max_value())
<u32 as TryFrom<_>>::try_from(elapsed_ms).unwrap_or(u32::MAX)
);
let speed = diff.saturating_mul(one_thousand).checked_div(&elapsed)