Skip to content

Commit

Permalink
fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wphan committed Oct 26, 2023
1 parent 9e30cdd commit 83bf8b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
large-error-threshold = 1_600_000
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ defaults:

env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: 1.60.0
SOLANA_VERSION: '1.13.7'
RUST_TOOLCHAIN: 1.67.0
SOLANA_VERSION: '1.14.7'

jobs:
fmt-clippy:
Expand Down
4 changes: 2 additions & 2 deletions programs/drift_vaults/src/instructions/constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn is_spot_market_for_vault(
market_index: u16,
) -> anchor_lang::Result<bool> {
Ok(
(&vault_depositor.load()?.spot_market_index).eq(&drift_spot_market.load()?.market_index)
&& (&vault_depositor.load()?.spot_market_index).eq(&market_index),
(vault_depositor.load()?.spot_market_index).eq(&drift_spot_market.load()?.market_index)
&& (vault_depositor.load()?.spot_market_index).eq(&market_index),
)
}
12 changes: 6 additions & 6 deletions programs/drift_vaults/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod vault_fcn {
assert_eq!(vault.manager_total_withdraws, 0);

vault
.manager_request_withdraw((amount - 1) as u64, WithdrawUnit::Token, vault_equity, now)
.manager_request_withdraw(amount - 1, WithdrawUnit::Token, vault_equity, now)
.unwrap();

assert_eq!(vault.user_shares, 0);
Expand Down Expand Up @@ -179,7 +179,7 @@ mod vault_fcn {
assert_eq!(vault_manager_amount, 100000000);

vault
.manager_request_withdraw(amount as u64, WithdrawUnit::Token, vault_equity, now)
.manager_request_withdraw(amount, WithdrawUnit::Token, vault_equity, now)
.unwrap();

let withdrew = vault.manager_withdraw(vault_equity, now).unwrap();
Expand Down Expand Up @@ -279,7 +279,7 @@ mod vault_fcn {

now += 100000;
vault
.manager_request_withdraw(amount as u64, WithdrawUnit::Token, vault_equity, now)
.manager_request_withdraw(amount, WithdrawUnit::Token, vault_equity, now)
.unwrap();
let withdrew = vault.manager_withdraw(vault_equity, now).unwrap();
assert_eq!(withdrew, amount);
Expand Down Expand Up @@ -324,7 +324,7 @@ mod vault_fcn {

assert_eq!(vault_manager_amount, 100000000);
vault
.manager_request_withdraw(amount as u64, WithdrawUnit::Token, vault_equity, now)
.manager_request_withdraw(amount, WithdrawUnit::Token, vault_equity, now)
.unwrap();

let withdrew = vault.manager_withdraw(vault_equity, now).unwrap();
Expand Down Expand Up @@ -388,7 +388,7 @@ mod vault_fcn {

assert_eq!(vault_manager_amount, 100001999);
vault
.manager_request_withdraw(amount as u64, WithdrawUnit::Token, vault_equity, now)
.manager_request_withdraw(amount, WithdrawUnit::Token, vault_equity, now)
.unwrap();

let withdrew = vault.manager_withdraw(vault_equity, now).unwrap();
Expand Down Expand Up @@ -475,7 +475,7 @@ mod vault_fcn {
assert_eq!(vault_manager_amount, 300002849); //$300??

vault
.manager_request_withdraw(amount as u64, WithdrawUnit::Token, vault_equity, now)
.manager_request_withdraw(amount, WithdrawUnit::Token, vault_equity, now)
.unwrap();
assert_eq!(amount, vault.last_manager_withdraw_request.value);

Expand Down

0 comments on commit 83bf8b6

Please sign in to comment.