Skip to content

Commit

Permalink
sui-sdk-types: address rust 1.82 clippy lints (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-mysten authored Dec 5, 2024
1 parent ae27938 commit b2e9b83
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/sui-sdk-types/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-sdk-types/src/types/crypto/zklogin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ mod serialization {

struct Inner<'a>(&'a [Bn254FieldElement; 2]);

impl<'a> Serialize for Inner<'a> {
impl Serialize for Inner<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down
6 changes: 6 additions & 0 deletions crates/sui-sdk-types/src/types/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down Expand Up @@ -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"));
}
Expand Down

0 comments on commit b2e9b83

Please sign in to comment.