Skip to content

Commit 0f054f2

Browse files
committed
chore: fmt
1 parent 3f2cf59 commit 0f054f2

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

src/ecdsa.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ mod tests {
115115
use mnemonic_external::{regular::InternalWordList, WordSet};
116116
use sp_core::{crypto::Pair, ecdsa};
117117

118-
#[cfg(feature="std")]
118+
#[cfg(feature = "std")]
119119
use std::format;
120120

121-
#[cfg(not(feature="std"))]
121+
#[cfg(not(feature = "std"))]
122122
use alloc::format;
123123

124124
use crate::common::{cut_path, ALICE_WORDS};

src/ed25519.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ mod tests {
8282
use mnemonic_external::{regular::InternalWordList, WordSet};
8383
use sp_core::{crypto::Pair, ed25519};
8484

85-
#[cfg(feature="std")]
85+
#[cfg(feature = "std")]
8686
use std::format;
8787

88-
#[cfg(not(feature="std"))]
88+
#[cfg(not(feature = "std"))]
8989
use alloc::format;
9090

9191
use crate::common::{cut_path, ALICE_WORDS};

src/error.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#[cfg(feature = "std")]
2-
use std::{fmt::{Debug, Display, Formatter, Result as FmtResult}, string::String};
2+
use std::{
3+
fmt::{Debug, Display, Formatter, Result as FmtResult},
4+
string::String,
5+
};
36

47
#[cfg(not(feature = "std"))]
58
use alloc::string::String;
@@ -33,7 +36,9 @@ impl Error {
3336
fn error_text(&self) -> String {
3437
match self {
3538
Error::Base58Checksum => String::from("Base58 checksum mismatch"),
36-
Error::Base58Decoding(from_base58_error) => format!("Base58 decoding error: {:?}", from_base58_error),
39+
Error::Base58Decoding(from_base58_error) => {
40+
format!("Base58 decoding error: {:?}", from_base58_error)
41+
}
3742
Error::Base58Length => String::from("Invalid base58 address length"),
3843
Error::Base58Prefix => String::from("Invalid base58 prefix value"),
3944
#[cfg(feature = "ecdsa")]
@@ -44,12 +49,18 @@ impl Error {
4449
Error::EcdsaSignatureGen => String::from("Signing failed"),
4550
#[cfg(feature = "ecdsa")]
4651
Error::EcdsaSignatureLength => String::from("Invalid ecdsa signature size"),
47-
Error::InvalidEntropy => String::from("Invalid entropy size, only 16, 20, 24, 28, and 32 bytes are supported"),
52+
Error::InvalidEntropy => String::from(
53+
"Invalid entropy size, only 16, 20, 24, 28, and 32 bytes are supported",
54+
),
4855
#[cfg(feature = "ecdsa")]
4956
Error::NoSoftDerivationEcdsa => String::from("Soft derivation is impossible for ecdsa"),
5057
#[cfg(feature = "ed25519")]
51-
Error::NoSoftDerivationEd25519 => String::from("Soft derivation is impossible for ed25519"),
52-
Error::Pbkdf2Internal => String::from("Pbkdf2 hashing internal error, please report this"),
58+
Error::NoSoftDerivationEd25519 => {
59+
String::from("Soft derivation is impossible for ed25519")
60+
}
61+
Error::Pbkdf2Internal => {
62+
String::from("Pbkdf2 hashing internal error, please report this")
63+
}
5364
}
5465
}
5566
}
@@ -62,4 +73,3 @@ impl Display for Error {
6273

6374
#[cfg(feature = "std")]
6475
impl std::error::Error for Error {}
65-

src/sr25519.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ mod tests {
136136
use rand_core::{CryptoRng, RngCore};
137137
use sp_core::{crypto::Pair, sr25519};
138138

139-
#[cfg(feature="std")]
139+
#[cfg(feature = "std")]
140140
use std::format;
141141

142-
#[cfg(not(feature="std"))]
142+
#[cfg(not(feature = "std"))]
143143
use alloc::format;
144144

145145
use crate::common::{cut_path, ALICE_WORDS};

0 commit comments

Comments
 (0)