mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-29 22:51:03 +00:00
[clippy] Fix clippy issues for crate sp-core (#8809)
* Fix clippy issues for crate sp-core * Update primitives/core/benches/bench.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update primitives/core/src/ed25519.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove clippy attributes * Missed a clippy attribute * remove clippy attributes for bechmarks as well Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -218,8 +218,8 @@ impl<'de> Deserialize<'de> for Signature {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de> {
|
||||
let signature_hex = hex::decode(&String::deserialize(deserializer)?)
|
||||
.map_err(|e| de::Error::custom(format!("{:?}", e)))?;
|
||||
Ok(Signature::try_from(signature_hex.as_ref())
|
||||
.map_err(|e| de::Error::custom(format!("{:?}", e)))?)
|
||||
Signature::try_from(signature_hex.as_ref())
|
||||
.map_err(|e| de::Error::custom(format!("{:?}", e)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ impl AsRef<schnorrkel::Keypair> for Pair {
|
||||
/// Derive a single hard junction.
|
||||
#[cfg(feature = "full_crypto")]
|
||||
fn derive_hard_junction(secret: &SecretKey, cc: &[u8; CHAIN_CODE_LENGTH]) -> MiniSecretKey {
|
||||
secret.hard_derive_mini_secret_key(Some(ChainCode(cc.clone())), b"").0
|
||||
secret.hard_derive_mini_secret_key(Some(ChainCode(*cc)), b"").0
|
||||
}
|
||||
|
||||
/// The raw secret seed, which can be used to recreate the `Pair`.
|
||||
@@ -762,7 +762,7 @@ mod test {
|
||||
"9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"
|
||||
));
|
||||
let path = Some(DeriveJunction::soft(1));
|
||||
let pair_1 = pair.derive(path.clone().into_iter(), None).unwrap().0;
|
||||
let pair_1 = pair.derive(path.into_iter(), None).unwrap().0;
|
||||
let public_1 = pair.public().derive(path.into_iter()).unwrap();
|
||||
assert_eq!(pair_1.public(), public_1);
|
||||
}
|
||||
@@ -879,7 +879,7 @@ mod test {
|
||||
#[test]
|
||||
fn signature_serialization_doesnt_panic() {
|
||||
fn deserialize_signature(text: &str) -> Result<Signature, serde_json::error::Error> {
|
||||
Ok(serde_json::from_str(text)?)
|
||||
serde_json::from_str(text)
|
||||
}
|
||||
assert!(deserialize_signature("Not valid json.").is_err());
|
||||
assert!(deserialize_signature("\"Not an actual signature.\"").is_err());
|
||||
|
||||
Reference in New Issue
Block a user