From a46f3d00b805f63aad092e0f7773c5a714478589 Mon Sep 17 00:00:00 2001 From: Szymon Wojtulewicz Date: Mon, 18 Mar 2024 11:33:42 +0000 Subject: [PATCH] make cargo clippy happy --- crates/account_sdk/src/felt_ser.rs | 9 ++++++--- crates/webauthn/tests/build.rs | 1 + crates/webauthn/tests/src/auth/expand_auth_data.rs | 2 -- crates/webauthn/tests/src/auth/helpers.rs | 2 -- crates/webauthn/tests/src/auth/mod_arithmetic.rs | 2 -- crates/webauthn/tests/src/auth/verify_ecdsa.rs | 1 - crates/webauthn/tests/src/auth/verify_signature.rs | 1 - crates/webauthn/tests/src/prop_utils.rs | 1 - .../webauthn/tests/src/session/prop_signature_proofs.rs | 1 - 9 files changed, 7 insertions(+), 13 deletions(-) diff --git a/crates/account_sdk/src/felt_ser.rs b/crates/account_sdk/src/felt_ser.rs index 81e6eac9..43b46205 100644 --- a/crates/account_sdk/src/felt_ser.rs +++ b/crates/account_sdk/src/felt_ser.rs @@ -129,9 +129,10 @@ impl<'a> ser::Serializer for &'a mut Serializer { Err(Error::TypeNotSupported) } - fn serialize_some(self, value: &T) -> Result<()> + fn serialize_some(self, value: &T) -> Result<()> where T: Serialize, + T: ?Sized, { Err(Error::TypeNotSupported) } @@ -153,14 +154,15 @@ impl<'a> ser::Serializer for &'a mut Serializer { Err(Error::TypeNotSupported) } - fn serialize_newtype_struct(self, name: &'static str, value: &T) -> Result<()> + fn serialize_newtype_struct(self, name: &'static str, value: &T) -> Result<()> where T: Serialize, + T: ?Sized, { value.serialize(self) } - fn serialize_newtype_variant( + fn serialize_newtype_variant( self, name: &'static str, variant_index: u32, @@ -169,6 +171,7 @@ impl<'a> ser::Serializer for &'a mut Serializer { ) -> Result<()> where T: Serialize, + T: ?Sized, { Err(Error::TypeNotSupported) } diff --git a/crates/webauthn/tests/build.rs b/crates/webauthn/tests/build.rs index 80fa34c8..4b14686a 100644 --- a/crates/webauthn/tests/build.rs +++ b/crates/webauthn/tests/build.rs @@ -27,4 +27,5 @@ fn main() { // It's important since we always want to test against the latest version of the code println!("cargo:rerun-if-changed=../auth"); println!("cargo:rerun-if-changed=../session"); + println!("cargo:rerun-if-changed=../../Scarb.toml"); } diff --git a/crates/webauthn/tests/src/auth/expand_auth_data.rs b/crates/webauthn/tests/src/auth/expand_auth_data.rs index 143c1e0c..bdab39ff 100644 --- a/crates/webauthn/tests/src/auth/expand_auth_data.rs +++ b/crates/webauthn/tests/src/auth/expand_auth_data.rs @@ -1,8 +1,6 @@ -use cairo_args_runner::{errors::SierraRunnerError, Arg, Felt252}; use proptest::{collection, prelude::*}; use crate::prelude::*; -use cairo_args_runner::SuccessfulRun; struct AuthDataParser; impl ArgumentParser for AuthDataParser { diff --git a/crates/webauthn/tests/src/auth/helpers.rs b/crates/webauthn/tests/src/auth/helpers.rs index 14c17c11..ea916572 100644 --- a/crates/webauthn/tests/src/auth/helpers.rs +++ b/crates/webauthn/tests/src/auth/helpers.rs @@ -1,7 +1,5 @@ use super::*; use crate::*; -use cairo_args_runner::SuccessfulRun; -use cairo_args_runner::{errors::SierraRunnerError, Arg, Felt252}; struct U256ArrParser; diff --git a/crates/webauthn/tests/src/auth/mod_arithmetic.rs b/crates/webauthn/tests/src/auth/mod_arithmetic.rs index f7e2889c..445c8c08 100644 --- a/crates/webauthn/tests/src/auth/mod_arithmetic.rs +++ b/crates/webauthn/tests/src/auth/mod_arithmetic.rs @@ -1,5 +1,3 @@ -use cairo_args_runner::{Arg, Felt252}; - use crate::prelude::*; /// ```extended_gcd(u256, u256) -> (u256, u256, u256)``` diff --git a/crates/webauthn/tests/src/auth/verify_ecdsa.rs b/crates/webauthn/tests/src/auth/verify_ecdsa.rs index 906d01dd..8301ad0c 100644 --- a/crates/webauthn/tests/src/auth/verify_ecdsa.rs +++ b/crates/webauthn/tests/src/auth/verify_ecdsa.rs @@ -1,5 +1,4 @@ use account_sdk::webauthn_signer::P256VerifyingKeyConverter; -use cairo_args_runner::Felt252; use p256::{ ecdsa::{signature::Signer, Signature, SigningKey}, elliptic_curve::{rand_core::OsRng, SecretKey}, diff --git a/crates/webauthn/tests/src/auth/verify_signature.rs b/crates/webauthn/tests/src/auth/verify_signature.rs index 068be783..184ed1f1 100644 --- a/crates/webauthn/tests/src/auth/verify_signature.rs +++ b/crates/webauthn/tests/src/auth/verify_signature.rs @@ -1,5 +1,4 @@ use account_sdk::webauthn_signer::P256VerifyingKeyConverter; -use cairo_args_runner::Felt252; use p256::{ ecdsa::{signature::Signer, Signature, SigningKey}, elliptic_curve::rand_core::OsRng, diff --git a/crates/webauthn/tests/src/prop_utils.rs b/crates/webauthn/tests/src/prop_utils.rs index a5341bd1..abe182e0 100644 --- a/crates/webauthn/tests/src/prop_utils.rs +++ b/crates/webauthn/tests/src/prop_utils.rs @@ -1,6 +1,5 @@ use cairo_args_runner::Felt252; use proptest::prelude::*; -use proptest::strategy::Strategy; #[derive(Debug, Clone, Copy)] pub struct Felt252Strategy; diff --git a/crates/webauthn/tests/src/session/prop_signature_proofs.rs b/crates/webauthn/tests/src/session/prop_signature_proofs.rs index b933a66d..021265be 100644 --- a/crates/webauthn/tests/src/session/prop_signature_proofs.rs +++ b/crates/webauthn/tests/src/session/prop_signature_proofs.rs @@ -1,6 +1,5 @@ use cairo_args_runner::Felt252; use proptest::prelude::*; -use proptest::strategy::Strategy; use crate::prop_utils::Felt252Strategy; use crate::session::signature_proofs::SIGNATURE_PROOFS;