Skip to content

Commit

Permalink
clippy + fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
0xripleys committed Oct 27, 2023
1 parent b25a441 commit d9a8883
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions token-lending/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,9 @@ fn _refresh_reserve<'a>(

/// Lite version of refresh_reserve that should be used when the oracle price doesn't need to be updated
/// BE CAREFUL WHEN USING THIS
fn _refresh_reserve_interest<'a>(
fn _refresh_reserve_interest(
program_id: &Pubkey,
reserve_info: &AccountInfo<'a>,
reserve_info: &AccountInfo<'_>,
clock: &Clock,
) -> ProgramResult {
let mut reserve = Reserve::unpack(&reserve_info.data.borrow())?;
Expand Down
2 changes: 1 addition & 1 deletion token-lending/program/tests/helpers/mock_pyth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl Processor {
msg!("Mock Pyth: Set price");
let price_account_info = next_account_info(account_info_iter)?;
let data = &mut price_account_info.try_borrow_mut_data()?;
let mut price_account: &mut PriceAccount = load_mut(data).unwrap();
let price_account: &mut PriceAccount = load_mut(data).unwrap();

price_account.agg.price = price;
price_account.agg.conf = conf;
Expand Down
3 changes: 1 addition & 2 deletions token-lending/sdk/examples/jito.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ pub fn main() {
.entry(obligation.owner)
.or_insert(Position::default());

position.borrow_balance +=
borrow.borrowed_amount_wads.try_round_u64().unwrap();
position.borrow_balance += borrow.borrowed_amount_wads.try_round_u64().unwrap();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion token-lending/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
pub mod error;
pub mod instruction;
pub mod math;
pub mod offchain_utils;
pub mod oracles;
pub mod state;
pub mod offchain_utils;

// Export current sdk types for downstream users building with a different sdk version
pub use solana_program;
Expand Down
11 changes: 3 additions & 8 deletions token-lending/sdk/src/offchain_utils.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
#![allow(missing_docs)]
use crate::{self as solend_program, error::LendingError};
use pyth_sdk_solana::Price;

use solana_client::rpc_client::RpcClient;
use solana_program::slot_history::Slot;
// use pyth_sdk_solana;
use solana_program::{
account_info::AccountInfo, msg, program_error::ProgramError, sysvar::clock::Clock,
};
use std::{convert::TryInto, result::Result};
use solana_program::program_error::ProgramError;
use std::result::Result;

use crate::{state::LastUpdate, NULL_PUBKEY};
use std::time::Duration;

use solana_program::{program_pack::Pack, pubkey::Pubkey};

use crate::math::{Decimal, Rate, TryAdd, TryMul};
use std::collections::HashSet;

use crate::state::{LendingMarket, Obligation, Reserve};
use std::{collections::HashMap, error::Error};
Expand Down

0 comments on commit d9a8883

Please sign in to comment.