clippy: Remove `useless_conversion` (#3899)

This commit is contained in:
Jon Cinque 2022-12-13 15:56:12 +01:00 committed by GitHub
parent 77a297c2c7
commit 5f4943802b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 20 additions and 44 deletions

1
Cargo.lock generated
View File

@ -5924,7 +5924,6 @@ name = "spl-feature-proposal"
version = "1.0.0"
dependencies = [
"borsh",
"borsh-derive",
"solana-program",
"solana-program-test",
"solana-sdk",

View File

@ -13,7 +13,6 @@ test-sbf = []
[dependencies]
borsh = "0.9"
borsh-derive = "0.9.0"
solana-program = "1.14.10"
spl-token = { version = "3.5", path = "../../token/program", features = ["no-entrypoint"] }

View File

@ -75,7 +75,6 @@ impl ProgramTestBench {
transaction.sign(&all_signers, recent_blockhash);
#[allow(clippy::useless_conversion)] // Remove during upgrade to 1.10
self.context
.banks_client
.process_transaction(transaction)

View File

@ -199,7 +199,6 @@ pub async fn sign_send_instruction(
payer_signers.push(s);
}
transaction.partial_sign(&payer_signers, ctx.last_blockhash);
#[allow(clippy::useless_conversion)] // Remove during upgrade to 1.10
ctx.banks_client
.process_transaction(transaction)
.await

View File

@ -143,14 +143,12 @@ async fn fail_on_invalid_mint() {
&[&ctx.payer, &account],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
err,
TransactionError::InstructionError(

View File

@ -88,14 +88,12 @@ async fn fail_extension_no_space() {
&[&ctx.payer, &mint_account],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
err,
TransactionError::InstructionError(1, InstructionError::InvalidAccountData)
@ -141,14 +139,12 @@ async fn fail_extension_after_mint_init() {
&[&ctx.payer, &mint_account],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
err,
TransactionError::InstructionError(1, InstructionError::InvalidAccountData)
@ -221,14 +217,12 @@ async fn fail_init_overallocated_mint() {
&[&ctx.payer, &mint_account],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
err,
TransactionError::InstructionError(1, InstructionError::InvalidAccountData)
@ -291,14 +285,12 @@ async fn fail_account_init_after_mint_extension() {
&[&ctx.payer, &mint_account, &token_account],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
err,
TransactionError::InstructionError(
@ -348,14 +340,12 @@ async fn fail_account_init_after_mint_init() {
&[&ctx.payer, &mint_account],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
err,
TransactionError::InstructionError(2, InstructionError::InvalidAccountData)
@ -408,14 +398,12 @@ async fn fail_account_init_after_mint_init_with_extension() {
&[&ctx.payer, &mint_account],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
err,
TransactionError::InstructionError(3, InstructionError::InvalidAccountData)
@ -464,14 +452,12 @@ async fn fail_fee_init_after_mint_init() {
&[&ctx.payer, &mint_account],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
err,
TransactionError::InstructionError(1, InstructionError::InvalidAccountData)

View File

@ -100,14 +100,12 @@ async fn test_memo_transfers(
&[&ctx.payer, &alice],
ctx.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let err: TransactionError = ctx
let err = ctx
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
drop(ctx);
assert_eq!(
err,

View File

@ -181,14 +181,12 @@ async fn fail_init_after_close_account() {
&[&context.payer, &owner],
context.last_blockhash,
);
#[allow(clippy::useless_conversion)]
let error: TransactionError = context
let error = context
.banks_client
.process_transaction(tx)
.await
.unwrap_err()
.unwrap()
.into();
.unwrap();
assert_eq!(
error,
TransactionError::InstructionError(2, InstructionError::InvalidAccountData)