Skip to content

Commit e034cb0

Browse files
committed
Clippy
1 parent 2dd601f commit e034cb0

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/db.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ impl LotAcquistion {
274274
}
275275

276276
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, EnumString, IntoStaticStr)]
277+
#[derive(Default)]
277278
pub enum LotSelectionMethod {
278279
#[strum(serialize = "fifo")]
280+
#[default]
279281
FirstInFirstOut,
280282
#[strum(serialize = "lifo")]
281283
LastInFirstOut,
@@ -299,11 +301,6 @@ impl LotSelectionMethod {
299301
pub const POSSIBLE_LOT_SELECTION_METHOD_VALUES: &[&str] =
300302
&["fifo", "lifo", "lowest-basis", "highest-basis"];
301303

302-
impl Default for LotSelectionMethod {
303-
fn default() -> Self {
304-
Self::FirstInFirstOut
305-
}
306-
}
307304

308305
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
309306
pub struct Lot {

src/vendor/solend/math/rate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl Rate {
7676
/// Calculates base^exp
7777
pub fn try_pow(&self, mut exp: u64) -> Result<Rate, ProgramError> {
7878
let mut base = *self;
79-
let mut ret = if exp % 2 != 0 {
79+
let mut ret = if !exp.is_multiple_of(2) {
8080
base
8181
} else {
8282
Rate(Self::wad())
@@ -86,7 +86,7 @@ impl Rate {
8686
exp /= 2;
8787
base = base.try_mul(base)?;
8888

89-
if exp % 2 != 0 {
89+
if !exp.is_multiple_of(2) {
9090
ret = ret.try_mul(base)?;
9191
}
9292
}

0 commit comments

Comments
 (0)