Skip to content

Commit f36ea03

Browse files
gui1117KalitaAlexey
authored andcommittedJul 9, 2021
fix deprecated usage of panic (paritytech#8134)
1 parent a064b55 commit f36ea03

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed
 

‎frame/executive/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ where
320320
) {
321321
extrinsics.into_iter().for_each(|e| if let Err(e) = Self::apply_extrinsic(e) {
322322
let err: &'static str = e.into();
323-
panic!(err)
323+
panic!("{}", err)
324324
});
325325

326326
// post-extrinsics book-keeping

‎frame/staking/reward-curve/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,13 @@ fn generate_piecewise_linear(points: Vec<(u32, u32)>) -> TokenStream2 {
353353
.unwrap_or(1_000_000_000);
354354

355355
for (x, y) in points {
356-
let error = || panic!(format!(
356+
let error = || panic!(
357357
"Generated reward curve approximation doesn't fit into [0, 1] -> [0, 1] \
358358
because of point:
359359
x = {:07} per million
360360
y = {:07} per million",
361361
x, y
362-
));
362+
);
363363

364364
let x_perbill = x.checked_mul(1_000).unwrap_or_else(error);
365365
let y_perbill = y.checked_mul(1_000).unwrap_or_else(error);

‎primitives/core/src/crypto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub enum PublicError {
224224

225225
/// Key that can be encoded to/from SS58.
226226
///
227-
/// See https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)#address-type
227+
/// See <https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)#address-type>
228228
/// for information on the codec.
229229
#[cfg(feature = "full_crypto")]
230230
pub trait Ss58Codec: Sized + AsMut<[u8]> + AsRef<[u8]> + Default {

‎primitives/core/src/hashing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! Hashing functions.
1919
//!
2020
//! This module is gated by `full-crypto` feature. If you intend to use any of the functions
21-
//! defined here within your runtime, you should most likely rather use [sp_io::hashing] instead,
21+
//! defined here within your runtime, you should most likely rather use `sp_io::hashing` instead,
2222
//! unless you know what you're doing. Using `sp_io` will be more performant, since instead of
2323
//! computing the hash in WASM it delegates that computation to the host client.
2424

‎primitives/inherents/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ pub trait ProvideInherent {
424424
/// - `Err(_)` indicates that this function failed and further operations should be aborted.
425425
///
426426
/// CAUTION: This check has a bug when used in pallets that also provide unsigned transactions.
427-
/// See https://github.com/paritytech/substrate/issues/6243 for details.
427+
/// See <https://github.com/paritytech/substrate/issues/6243> for details.
428428
fn is_inherent_required(_: &InherentData) -> Result<Option<Self::Error>, Self::Error> { Ok(None) }
429429

430430
/// Check whether the given inherent is valid. Checking the inherent is optional and can be

0 commit comments

Comments
 (0)
Please sign in to comment.