From b2e9b833e3847ac22fe2b07adbaee4af353c9803 Mon Sep 17 00:00:00 2001 From: stefan-mysten <135084671+stefan-mysten@users.noreply.github.com> Date: Thu, 5 Dec 2024 06:37:53 -0800 Subject: [PATCH] sui-sdk-types: address rust 1.82 clippy lints (#65) --- crates/sui-sdk-types/src/hash.rs | 2 +- crates/sui-sdk-types/src/types/crypto/zklogin.rs | 2 +- crates/sui-sdk-types/src/types/object.rs | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/sui-sdk-types/src/hash.rs b/crates/sui-sdk-types/src/hash.rs index 77ab94c86..71532ed43 100644 --- a/crates/sui-sdk-types/src/hash.rs +++ b/crates/sui-sdk-types/src/hash.rs @@ -266,7 +266,7 @@ mod signing_message { hasher.finalize() } - impl<'a> PersonalMessage<'a> { + impl PersonalMessage<'_> { pub fn signing_digest(&self) -> SigningDigest { const INTENT: Intent = Intent { scope: IntentScope::PersonalMessage, diff --git a/crates/sui-sdk-types/src/types/crypto/zklogin.rs b/crates/sui-sdk-types/src/types/crypto/zklogin.rs index 5f443a115..c5c5f16f7 100644 --- a/crates/sui-sdk-types/src/types/crypto/zklogin.rs +++ b/crates/sui-sdk-types/src/types/crypto/zklogin.rs @@ -492,7 +492,7 @@ mod serialization { struct Inner<'a>(&'a [Bn254FieldElement; 2]); - impl<'a> Serialize for Inner<'a> { + impl Serialize for Inner<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, diff --git a/crates/sui-sdk-types/src/types/object.rs b/crates/sui-sdk-types/src/types/object.rs index c664f6669..04d3f30f4 100644 --- a/crates/sui-sdk-types/src/types/object.rs +++ b/crates/sui-sdk-types/src/types/object.rs @@ -731,6 +731,9 @@ mod serialization { }), ) => { // check id matches in contents + // switch to if id_opt(&contents).is_none_or(|id| id != object_id) when the + // API of is_none_or is stabilized as now this would fail in wasm tests + #[allow(clippy::nonminimal_bool)] if !id_opt(&contents).is_some_and(|id| id == object_id) { return Err(serde::de::Error::custom("id from contents doesn't match")); } @@ -890,6 +893,9 @@ mod serialization { }), ) => { // check id matches in contents + // switch to if id_opt(&contents).is_none_or(|id| id != object_id) when the + // API of is_none_or is stabilized as now this would fail in wasm tests + #[allow(clippy::nonminimal_bool)] if !id_opt(&contents).is_some_and(|id| id == object_id) { return Err(serde::de::Error::custom("id from contents doesn't match")); }