Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit f43e333

Browse files
committed
Fix further cargo clippy --test warnings following rebase.
1 parent eb3a346 commit f43e333

File tree

4 files changed

+18
-27
lines changed

4 files changed

+18
-27
lines changed

cli/src/checks.rs

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ mod tests {
9797
let mut mocks = HashMap::new();
9898
mocks.insert(RpcRequest::GetBalance, account_balance_response.clone());
9999
let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
100-
assert_eq!(
101-
check_account_for_fee(&rpc_client, &pubkey, &fee_calculator, &message0).unwrap(),
102-
()
103-
);
100+
check_account_for_fee(&rpc_client, &pubkey, &fee_calculator, &message0)
101+
.expect("unexpected result");
104102

105103
let mut mocks = HashMap::new();
106104
mocks.insert(RpcRequest::GetBalance, account_balance_response.clone());
@@ -128,16 +126,13 @@ mod tests {
128126
mocks.insert(RpcRequest::GetBalance, account_balance_response);
129127
let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
130128

131-
assert_eq!(
132-
check_account_for_multiple_fees(
133-
&rpc_client,
134-
&pubkey,
135-
&fee_calculator,
136-
&[&message0, &message0]
137-
)
138-
.unwrap(),
139-
()
140-
);
129+
check_account_for_multiple_fees(
130+
&rpc_client,
131+
&pubkey,
132+
&fee_calculator,
133+
&[&message0, &message0],
134+
)
135+
.expect("unexpected result");
141136
}
142137

143138
#[test]
@@ -194,19 +189,14 @@ mod tests {
194189
#[test]
195190
fn test_check_unique_pubkeys() {
196191
let pubkey0 = Pubkey::new_rand();
197-
let pubkey_clone = pubkey0.clone();
192+
let pubkey_clone = pubkey0;
198193
let pubkey1 = Pubkey::new_rand();
199194

200-
assert_eq!(
201-
check_unique_pubkeys((&pubkey0, "foo".to_string()), (&pubkey1, "bar".to_string()))
202-
.unwrap(),
203-
()
204-
);
205-
assert_eq!(
206-
check_unique_pubkeys((&pubkey0, "foo".to_string()), (&pubkey1, "foo".to_string()))
207-
.unwrap(),
208-
()
209-
);
195+
check_unique_pubkeys((&pubkey0, "foo".to_string()), (&pubkey1, "bar".to_string()))
196+
.expect("unexpected result");
197+
check_unique_pubkeys((&pubkey0, "foo".to_string()), (&pubkey1, "foo".to_string()))
198+
.expect("unexpected result");
199+
210200
assert!(check_unique_pubkeys(
211201
(&pubkey0, "foo".to_string()),
212202
(&pubkey_clone, "bar".to_string())

core/src/gossip_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ mod tests {
343343
assert_eq!(met_criteria, true);
344344

345345
let (met_criteria, _, _, _) = spy(
346-
spy_ref.clone(),
346+
spy_ref,
347347
None,
348348
Some(0),
349349
None,

remote-wallet/src/ledger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ mod tests {
575575

576576
#[test]
577577
fn test_parse_status() {
578-
assert_eq!(LedgerWallet::parse_status(APDU_SUCCESS_CODE).unwrap(), ());
578+
LedgerWallet::parse_status(APDU_SUCCESS_CODE).expect("unexpected result");
579579
if let RemoteWalletError::LedgerError(err) = LedgerWallet::parse_status(0x6985).unwrap_err()
580580
{
581581
assert_eq!(err, LedgerError::UserCancel);

runtime/src/bank.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5825,6 +5825,7 @@ mod tests {
58255825
}
58265826

58275827
#[test]
5828+
#[allow(clippy::float_cmp)]
58285829
fn test_check_point_value() {
58295830
let (genesis_config, _) = create_genesis_config(500);
58305831
let bank = Arc::new(Bank::new(&genesis_config));

0 commit comments

Comments
 (0)