mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 03:31:05 +00:00
fix deprecated usage of panic (#8134)
This commit is contained in:
committed by
GitHub
parent
ed9c08dd01
commit
f49aae65a8
@@ -353,13 +353,13 @@ fn generate_piecewise_linear(points: Vec<(u32, u32)>) -> TokenStream2 {
|
||||
.unwrap_or(1_000_000_000);
|
||||
|
||||
for (x, y) in points {
|
||||
let error = || panic!(format!(
|
||||
let error = || panic!(
|
||||
"Generated reward curve approximation doesn't fit into [0, 1] -> [0, 1] \
|
||||
because of point:
|
||||
x = {:07} per million
|
||||
y = {:07} per million",
|
||||
x, y
|
||||
));
|
||||
);
|
||||
|
||||
let x_perbill = x.checked_mul(1_000).unwrap_or_else(error);
|
||||
let y_perbill = y.checked_mul(1_000).unwrap_or_else(error);
|
||||
|
||||
Reference in New Issue
Block a user