Skip to content

Commit

Permalink
updated cargo clippy fix for starknet-core, starknet-contract and sta…
Browse files Browse the repository at this point in the history
…rknet-accounts
  • Loading branch information
aniketpr01 committed Jun 17, 2024
1 parent 9757b7c commit 9102b4a
Show file tree
Hide file tree
Showing 21 changed files with 204 additions and 204 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ no_unknown_fields = [

[workspace.lints]
rust.missing_debug_implementations = "warn"
rust.unreachable_pub = "warn"
rust.unused_must_use = "deny"
rust.rust_2018_idioms = { level = "deny", priority = -1 }
rustdoc.all = "warn"
Expand Down
1 change: 1 addition & 0 deletions starknet-accounts/tests/single_owner_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn create_sequencer_client() -> SequencerGatewayProvider {
}

fn create_jsonrpc_client() -> JsonRpcClient<HttpTransport> {
#[allow(clippy::or_fun_call)]
let rpc_url = std::env::var("STARKNET_RPC")
.unwrap_or("https://juno.rpc.sepolia.starknet.rs/rpc/v0_7".into());
JsonRpcClient::new(HttpTransport::new(url::Url::parse(&rpc_url).unwrap()))
Expand Down
3 changes: 3 additions & 0 deletions starknet-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ rand = { version = "0.8.5", features=["std_rng"] }
starknet-signers = { version = "0.9.0", path = "../starknet-signers" }
tokio = { version = "1.27.0", features = ["full"] }
url = "2.3.1"

[lints]
workspace = true
3 changes: 3 additions & 0 deletions starknet-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ harness = false
[[bench]]
name = "sierra_class_hash"
harness = false

[lints]
workspace = true
1 change: 0 additions & 1 deletion starknet-core/src/chain_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ mod test {
("SN_GOERLI2", TESTNET2),
("SN_SEPOLIA", SEPOLIA),
]
.into_iter()
{
assert_eq!(cairo_short_string_to_felt(text).unwrap(), felt);
}
Expand Down
2 changes: 1 addition & 1 deletion starknet-core/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub use errors::{EcdsaSignError, EcdsaVerifyError};
pub fn compute_hash_on_elements(data: &[Felt]) -> Felt {
let mut current_hash = Felt::ZERO;

for item in data.iter() {
for item in data {
current_hash = pedersen_hash(&current_hash, item);
}

Expand Down
2 changes: 1 addition & 1 deletion starknet-core/src/serde/byte_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub mod base64 {
impl<'de> Visitor<'de> for Base64Visitor {
type Value = Vec<u8>;

fn expecting(&self, formatter: &mut Formatter) -> alloc::fmt::Result {
fn expecting(&self, formatter: &mut Formatter<'_>) -> alloc::fmt::Result {
write!(formatter, "string")
}

Expand Down
2 changes: 1 addition & 1 deletion starknet-core/src/serde/num_hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub mod u64 {
impl<'de> Visitor<'de> for NumHexVisitor {
type Value = u64;

fn expecting(&self, formatter: &mut Formatter) -> alloc::fmt::Result {
fn expecting(&self, formatter: &mut Formatter<'_>) -> alloc::fmt::Result {
write!(formatter, "string")
}

Expand Down
9 changes: 6 additions & 3 deletions starknet-core/src/serde/unsigned_field_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ use serde_with::{DeserializeAs, SerializeAs};

use starknet_types_core::felt::Felt;

#[derive(Debug)]
pub struct UfeHex;

#[derive(Debug)]
pub struct UfeHexOption;

#[derive(Debug)]
pub struct UfePendingBlockHash;

struct UfeHexVisitor;
Expand Down Expand Up @@ -39,7 +42,7 @@ impl<'de> DeserializeAs<'de, Felt> for UfeHex {
impl<'de> Visitor<'de> for UfeHexVisitor {
type Value = Felt;

fn expecting(&self, formatter: &mut Formatter) -> alloc::fmt::Result {
fn expecting(&self, formatter: &mut Formatter<'_>) -> alloc::fmt::Result {
write!(formatter, "string")
}

Expand Down Expand Up @@ -75,7 +78,7 @@ impl<'de> DeserializeAs<'de, Option<Felt>> for UfeHexOption {
impl<'de> Visitor<'de> for UfeHexOptionVisitor {
type Value = Option<Felt>;

fn expecting(&self, formatter: &mut Formatter) -> alloc::fmt::Result {
fn expecting(&self, formatter: &mut Formatter<'_>) -> alloc::fmt::Result {
write!(formatter, "string")
}

Expand Down Expand Up @@ -118,7 +121,7 @@ impl<'de> DeserializeAs<'de, Option<Felt>> for UfePendingBlockHash {
impl<'de> Visitor<'de> for UfePendingBlockHashVisitor {
type Value = Option<Felt>;

fn expecting(&self, formatter: &mut Formatter) -> alloc::fmt::Result {
fn expecting(&self, formatter: &mut Formatter<'_>) -> alloc::fmt::Result {
write!(formatter, "string")
}

Expand Down
Loading

0 comments on commit 9102b4a

Please sign in to comment.