Skip to content

Commit 1111a72

Browse files
authored
chore: make nightly clippy happy again (#662)
Allows `clippy::needless_return` as it causes false positives in tests.
1 parent 6853ac6 commit 1111a72

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- name: "Set allowed lints"
8282
run: |
8383
if [ "${{ matrix.toolchain }}" == "nightly" ]; then
84-
echo "ALLOWED=-A non_local_definitions -A clippy::too_long_first_doc_paragraph" >> $GITHUB_ENV
84+
echo "ALLOWED=-A non_local_definitions -A clippy::too_long_first_doc_paragraph -A clippy::needless_return" >> $GITHUB_ENV
8585
else
8686
echo "ALLOWED=" >> $GITHUB_ENV
8787
fi

starknet-accounts/src/account/declaration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ where
486486
let gas_price =
487487
u64::from_le_bytes(gas_price_bytes[..8].try_into().unwrap());
488488

489-
(((overall_fee + gas_price - 1) / gas_price) as f64
490-
* self.gas_estimate_multiplier) as u64
489+
(overall_fee.div_ceil(gas_price) as f64 * self.gas_estimate_multiplier)
490+
as u64
491491
}
492492
};
493493

starknet-accounts/src/account/execution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ where
466466
let gas_price =
467467
u64::from_le_bytes(gas_price_bytes[..8].try_into().unwrap());
468468

469-
((((overall_fee + gas_price - 1) / gas_price) as f64)
470-
* self.gas_estimate_multiplier) as u64
469+
((overall_fee.div_ceil(gas_price) as f64) * self.gas_estimate_multiplier)
470+
as u64
471471
}
472472
};
473473

starknet-accounts/src/factory/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ where
694694
let gas_price =
695695
u64::from_le_bytes(gas_price_bytes[..8].try_into().unwrap());
696696

697-
((((overall_fee + gas_price - 1) / gas_price) as f64)
698-
* self.gas_estimate_multiplier) as u64
697+
((overall_fee.div_ceil(gas_price) as f64) * self.gas_estimate_multiplier)
698+
as u64
699699
}
700700
};
701701

starknet-accounts/tests/single_owner_account.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ async fn can_execute_eth_transfer_invoke_v3_inner<P: Provider + Send + Sync>(
355355
calldata: vec![Felt::from_hex("0x1234").unwrap(), Felt::ONE, Felt::ZERO],
356356
}])
357357
.gas(100000)
358-
.gas_price(800000000000000)
358+
.gas_price(900000000000000)
359359
.send()
360360
.await
361361
.unwrap();
@@ -545,7 +545,7 @@ async fn can_declare_cairo1_contract_v3_inner<P: Provider + Send + Sync>(
545545
Felt::from_hex(&hashes.compiled_class_hash).unwrap(),
546546
)
547547
.gas(100000)
548-
.gas_price(800000000000000)
548+
.gas_price(900000000000000)
549549
.send()
550550
.await
551551
.unwrap();

starknet-contract/tests/contract_deployment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async fn can_deploy_contract_to_alpha_sepolia_with_invoke_v3() {
8181
let result = factory
8282
.deploy_v3(vec![Felt::ONE], Felt::from_bytes_be(&salt_buffer), true)
8383
.gas(100000)
84-
.gas_price(800000000000000)
84+
.gas_price(900000000000000)
8585
.send()
8686
.await;
8787

0 commit comments

Comments
 (0)