Skip to content

Commit 80b8dac

Browse files
authored
clippy: useless_conversion (anza-xyz#5060)
1 parent ea4cfd2 commit 80b8dac

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

banks-client/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ impl BanksClient {
448448
.await?
449449
.map(|x| x.0)
450450
.ok_or(BanksClientError::ClientError("valid blockhash not found"))
451-
.map_err(Into::into)
452451
}
453452

454453
pub async fn get_latest_blockhash_with_commitment(

cli/src/checks.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
use {
2-
crate::cli::CliError,
3-
solana_commitment_config::CommitmentConfig,
4-
solana_message::Message,
5-
solana_native_token::lamports_to_sol,
6-
solana_pubkey::Pubkey,
2+
crate::cli::CliError, solana_commitment_config::CommitmentConfig, solana_message::Message,
3+
solana_native_token::lamports_to_sol, solana_pubkey::Pubkey,
74
solana_rpc_client::rpc_client::RpcClient,
8-
solana_rpc_client_api::client_error::{Error as ClientError, Result as ClientResult},
5+
solana_rpc_client_api::client_error::Result as ClientResult,
96
};
107

118
pub fn check_account_for_fee(
@@ -96,9 +93,7 @@ pub fn check_account_for_spend_and_fee_with_commitment(
9693
account_pubkey,
9794
required_balance,
9895
commitment,
99-
)
100-
.map_err(Into::<ClientError>::into)?
101-
{
96+
)? {
10297
if balance > 0 {
10398
return Err(CliError::InsufficientFundsForSpendAndFee(
10499
lamports_to_sol(balance),

programs/bpf_loader/src/syscalls/mem_ops.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,15 @@ where
341341
src_addr,
342342
n_bytes,
343343
resize_area,
344-
)
345-
.map_err(EbpfError::from)?;
344+
)?;
346345
let mut dst_chunk_iter = MemoryChunkIterator::new(
347346
memory_mapping,
348347
accounts,
349348
dst_access,
350349
dst_addr,
351350
n_bytes,
352351
resize_area,
353-
)
354-
.map_err(EbpfError::from)?;
352+
)?;
355353

356354
let mut src_chunk = None;
357355
let mut dst_chunk = None;

0 commit comments

Comments
 (0)