File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1048,7 +1048,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
10481048 let apy_as_bps = ( apy * 100. ) as u64 ;
10491049
10501050 let value = if bps {
1051- format ! ( "{}" , apy_as_bps )
1051+ format ! ( "{apy_as_bps}" )
10521052 } else {
10531053 format ! ( "{:.2}" , apy_as_bps as f64 / 100. )
10541054 } ;
@@ -1730,7 +1730,7 @@ async fn mfi_load_user_account(
17301730
17311731 let first_user_account = accounts. next ( ) ;
17321732 if accounts. next ( ) . is_some ( ) {
1733- return Err ( format ! ( "Multiple MarginFi account found for {}" , wallet_address ) . into ( ) ) ;
1733+ return Err ( format ! ( "Multiple MarginFi account found for {wallet_address}" ) . into ( ) ) ;
17341734 }
17351735
17361736 Ok ( match first_user_account {
Original file line number Diff line number Diff line change @@ -642,38 +642,30 @@ impl DbData {
642642 . collect ( ) ,
643643 open_orders : db. get ( "orders" ) . unwrap_or_default ( ) ,
644644 disposed_lots : db. get ( "disposed-lots" ) . unwrap_or_default ( ) ,
645- pending_deposits : db
646- . lexists ( "deposits" )
647- . then ( || {
645+ pending_deposits : if db
646+ . lexists ( "deposits" ) { {
648647 db. liter ( "deposits" )
649648 . filter_map ( |item_iter| item_iter. get_item ( ) )
650649 . collect ( )
651- } )
652- . unwrap_or_default ( ) ,
653- pending_withdrawals : db
654- . lexists ( "withdrawals" )
655- . then ( || {
650+ } } else { Default :: default ( ) } ,
651+ pending_withdrawals : if db
652+ . lexists ( "withdrawals" ) { {
656653 db. liter ( "withdrawals" )
657654 . filter_map ( |item_iter| item_iter. get_item ( ) )
658655 . collect ( )
659- } )
660- . unwrap_or_default ( ) ,
661- pending_transfers : db
662- . lexists ( "transfers" )
663- . then ( || {
656+ } } else { Default :: default ( ) } ,
657+ pending_transfers : if db
658+ . lexists ( "transfers" ) { {
664659 db. liter ( "transfers" )
665660 . filter_map ( |item_iter| item_iter. get_item ( ) )
666661 . collect ( )
667- } )
668- . unwrap_or_default ( ) ,
669- pending_swaps : db
670- . lexists ( "swaps" )
671- . then ( || {
662+ } } else { Default :: default ( ) } ,
663+ pending_swaps : if db
664+ . lexists ( "swaps" ) { {
672665 db. liter ( "swaps" )
673666 . filter_map ( |item_iter| item_iter. get_item ( ) )
674667 . collect ( )
675- } )
676- . unwrap_or_default ( ) ,
668+ } } else { Default :: default ( ) } ,
677669 sweep_stake_account : db. get ( "sweep-stake-account" ) ,
678670 transitory_sweep_stake_accounts : db
679671 . get ( "transitory-sweep-stake-accounts" )
Original file line number Diff line number Diff line change 1111#![ allow( clippy:: assign_op_pattern) ]
1212#![ allow( clippy:: ptr_offset_with_cast) ]
1313#![ allow( clippy:: manual_range_contains) ]
14+ #![ allow( clippy:: manual_div_ceil) ]
1415
1516use crate :: vendor:: solend:: {
1617 error:: LendingError ,
@@ -21,7 +22,6 @@ use std::{convert::TryFrom, fmt};
2122use uint:: construct_uint;
2223
2324// U192 with 192 bits consisting of 3 x 64-bit words
24- #[ allow( clippy:: manual_div_ceil) ]
2525construct_uint ! {
2626 pub struct U192 ( 3 ) ;
2727}
@@ -124,7 +124,7 @@ impl fmt::Display for Decimal {
124124
125125impl fmt:: Debug for Decimal {
126126 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
127- write ! ( f, "{}" , self )
127+ write ! ( f, "{self}" )
128128 }
129129}
130130
Original file line number Diff line number Diff line change 1717#![ allow( clippy:: ptr_offset_with_cast) ]
1818#![ allow( clippy:: reversed_empty_ranges) ]
1919#![ allow( clippy:: manual_range_contains) ]
20+ #![ allow( clippy:: manual_div_ceil) ]
2021
2122use crate :: vendor:: solend:: {
2223 error:: LendingError ,
@@ -27,7 +28,6 @@ use std::{convert::TryFrom, fmt};
2728use uint:: construct_uint;
2829
2930// U128 with 128 bits consisting of 2 x 64-bit words
30- #[ allow( clippy:: manual_div_ceil) ]
3131construct_uint ! {
3232 pub struct U128 ( 2 ) ;
3333}
You can’t perform that action at this time.
0 commit comments