Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix-ci][sdk-types] Fix as per clippy suggestions #65

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading