Skip to content

Commit

Permalink
fix: clippies on latest rust 1.75
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Jan 2, 2024
1 parent cd0f704 commit 82815a9
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 47 deletions.
4 changes: 2 additions & 2 deletions applications/tari_dan_wallet_cli/src/command/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ pub async fn handle_claim_burn(args: ClaimBurnArgs, client: &mut WalletDaemonCli
let req = ClaimBurnRequest {
account,
claim_proof,
max_fee: fee.map(|f| f.try_into()).transpose()?,
max_fee: fee.map(Into::into),
};

let resp = client
Expand Down Expand Up @@ -370,7 +370,7 @@ pub async fn handle_reveal_funds(args: RevealFundsArgs, client: &mut WalletDaemo
.accounts_reveal_funds(RevealFundsRequest {
account,
amount_to_reveal: Amount::try_from(reveal_amount).expect("Reveal amount too large"),
max_fee: max_fee.map(|f| f.try_into()).transpose()?,
max_fee: max_fee.map(Into::into),
pay_fee_from_reveal: pay_from_reveal,
})
.await?;
Expand Down
2 changes: 0 additions & 2 deletions dan_layer/consensus_tests/src/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ mod transaction;
mod validator;

pub use address::*;
pub use epoch_manager::*;
pub use harness::*;
pub use leader_strategy::*;
pub use network::*;
pub use signing_service::*;
pub use spec::*;
pub use state_manager::*;
pub use transaction::*;
Expand Down
2 changes: 1 addition & 1 deletion dan_layer/engine/src/wasm/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl Invokable for WasmProcess {
},
};
let ptr = val
.get(0)
.first()
.and_then(|v| v.i32())
.ok_or(WasmExecutionError::ExpectedPointerReturn { function: main_name })?;

Expand Down
29 changes: 0 additions & 29 deletions dan_layer/state_store_sqlite/src/sql_models/locked_output.rs

This file was deleted.

2 changes: 0 additions & 2 deletions dan_layer/state_store_sqlite/src/sql_models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
mod block;
mod bookkeeping;
mod leaf_block;
mod locked_output;
mod quorum_certificate;
mod substate;
mod transaction;
Expand All @@ -14,7 +13,6 @@ mod vote;
pub use block::*;
pub use bookkeeping::*;
pub use leaf_block::*;
pub use locked_output::*;
pub use quorum_certificate::*;
pub use substate::*;
pub use transaction::*;
Expand Down
2 changes: 1 addition & 1 deletion dan_layer/tari_bor/src/json_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl serde::Serialize for CborValueJsonSerializeWrapper<'_> {
where S: serde::Serializer {
match self.0 {
Value::Integer(ref __field0) => {
let value = i128::try_from(*__field0).map_err(serde::ser::Error::custom)?;
let value = i128::from(*__field0);
serializer.serialize_newtype_variant("Value", 1u32, "Integer", &value)
},
Value::Bytes(ref __field0) => {
Expand Down
12 changes: 3 additions & 9 deletions integration_tests/tests/steps/wallet_daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,8 @@ async fn when_i_create_account_via_wallet_daemon_with_free_coins(
wallet_daemon_name: String,
amount: i64,
) {
wallet_daemon_cli::create_account_with_free_coins(
world,
account_name,
wallet_daemon_name,
amount.try_into().unwrap(),
None,
)
.await;
wallet_daemon_cli::create_account_with_free_coins(world, account_name, wallet_daemon_name, amount.into(), None)
.await;
}

#[when(expr = "I create a key named {word} for {word}")]
Expand All @@ -209,7 +203,7 @@ async fn when_i_create_account_via_wallet_daemon_with_free_coins_using_key(
world,
account_name,
wallet_daemon_name,
amount.try_into().unwrap(),
amount.into(),
Some(key_name),
)
.await;
Expand Down
2 changes: 1 addition & 1 deletion utilities/transaction_generator/src/transaction_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn read_transactions<R: Read + Seek + Send + 'static>(
while remaining > 0 {
let mut len_bytes = [0u8; 2];
reader.read_exact(&mut len_bytes).unwrap();
let len = u64::try_from(u16::from_le_bytes(len_bytes)).unwrap();
let len = u64::from(u16::from_le_bytes(len_bytes));

if skip_remaining > 0 {
skip_remaining -= 1;
Expand Down

0 comments on commit 82815a9

Please sign in to comment.