Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Dec 24, 2024
1 parent bd28a2e commit 7b8d966
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,7 @@ impl Suite {
cw20::Expiration::Never {} => return 0,
};

if expiration_unit > current_unit {
expiration_unit - current_unit
} else {
0
}
expiration_unit.saturating_sub(current_unit)
}

pub fn get_balance_native<T: Into<String>, U: Into<String>>(
Expand Down
4 changes: 2 additions & 2 deletions contracts/external/cw-payroll-factory/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub struct TokenIndexes<'a> {
pub recipient: MultiIndex<'a, String, VestingContract, String>,
}

impl<'a> IndexList<VestingContract> for TokenIndexes<'a> {
fn get_indexes(&'_ self) -> Box<dyn Iterator<Item = &'_ dyn Index<VestingContract>> + '_> {
impl IndexList<VestingContract> for TokenIndexes<'_> {
fn get_indexes(&self) -> Box<dyn Iterator<Item = &dyn Index<VestingContract>> + '_> {
let v: Vec<&dyn Index<VestingContract>> = vec![&self.instantiator, &self.recipient];
Box::new(v.into_iter())
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/voting/dao-voting-cw721-staked/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn register_staked_nft(
storage: &mut dyn Storage,
height: u64,
staker: &Addr,
token_id: &String,
token_id: &str,
) -> StdResult<()> {
let add_one = |prev: Option<Uint128>| -> StdResult<Uint128> {
prev.unwrap_or_default()
Expand Down
2 changes: 1 addition & 1 deletion packages/cw-snapshot-vector-map/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct LoadedItem<V> {
pub expiration: Option<u64>,
}

impl<'a, K, V> SnapshotVectorMap<'a, K, V> {
impl<K, V> SnapshotVectorMap<'_, K, V> {
/// Creates a new [`SnapshotVectorMap`] with the given storage keys.
///
/// Example:
Expand Down
6 changes: 3 additions & 3 deletions packages/dao-testing/src/suite/cw20_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ pub struct Cw20DaoExtra {

pub type Cw20TestDao = TestDao<Cw20DaoExtra>;

impl<'a> Deref for DaoTestingSuiteCw20<'a> {
impl Deref for DaoTestingSuiteCw20<'_> {
type Target = DaoTestingSuiteBase;

fn deref(&self) -> &Self::Target {
self.base
}
}

impl<'a> DerefMut for DaoTestingSuiteCw20<'a> {
impl DerefMut for DaoTestingSuiteCw20<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.base
}
Expand Down Expand Up @@ -143,7 +143,7 @@ impl<'a> DaoTestingSuiteCw20<'a> {
}
}

impl<'a> DaoTestingSuite<Cw20DaoExtra> for DaoTestingSuiteCw20<'a> {
impl DaoTestingSuite<Cw20DaoExtra> for DaoTestingSuiteCw20<'_> {
fn base(&self) -> &DaoTestingSuiteBase {
self
}
Expand Down
6 changes: 3 additions & 3 deletions packages/dao-testing/src/suite/cw4_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ pub struct Cw4DaoExtra {

pub type Cw4TestDao = TestDao<Cw4DaoExtra>;

impl<'a> Deref for DaoTestingSuiteCw4<'a> {
impl Deref for DaoTestingSuiteCw4<'_> {
type Target = DaoTestingSuiteBase;

fn deref(&self) -> &Self::Target {
self.base
}
}

impl<'a> DerefMut for DaoTestingSuiteCw4<'a> {
impl DerefMut for DaoTestingSuiteCw4<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.base
}
Expand Down Expand Up @@ -66,7 +66,7 @@ impl<'a> DaoTestingSuiteCw4<'a> {
}
}

impl<'a> DaoTestingSuite<Cw4DaoExtra> for DaoTestingSuiteCw4<'a> {
impl DaoTestingSuite<Cw4DaoExtra> for DaoTestingSuiteCw4<'_> {
fn base(&self) -> &DaoTestingSuiteBase {
self
}
Expand Down
6 changes: 3 additions & 3 deletions packages/dao-testing/src/suite/cw721_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ pub struct Cw721DaoExtra {

pub type Cw721TestDao = TestDao<Cw721DaoExtra>;

impl<'a> Deref for DaoTestingSuiteCw721<'a> {
impl Deref for DaoTestingSuiteCw721<'_> {
type Target = DaoTestingSuiteBase;

fn deref(&self) -> &Self::Target {
self.base
}
}

impl<'a> DerefMut for DaoTestingSuiteCw721<'a> {
impl DerefMut for DaoTestingSuiteCw721<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.base
}
Expand Down Expand Up @@ -128,7 +128,7 @@ impl<'a> DaoTestingSuiteCw721<'a> {
}
}

impl<'a> DaoTestingSuite<Cw721DaoExtra> for DaoTestingSuiteCw721<'a> {
impl DaoTestingSuite<Cw721DaoExtra> for DaoTestingSuiteCw721<'_> {
fn base(&self) -> &DaoTestingSuiteBase {
self
}
Expand Down
6 changes: 3 additions & 3 deletions packages/dao-testing/src/suite/token_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ pub struct TokenDaoExtra {

pub type TokenTestDao = TestDao<TokenDaoExtra>;

impl<'a> Deref for DaoTestingSuiteToken<'a> {
impl Deref for DaoTestingSuiteToken<'_> {
type Target = DaoTestingSuiteBase;

fn deref(&self) -> &Self::Target {
self.base
}
}

impl<'a> DerefMut for DaoTestingSuiteToken<'a> {
impl DerefMut for DaoTestingSuiteToken<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.base
}
Expand Down Expand Up @@ -136,7 +136,7 @@ impl<'a> DaoTestingSuiteToken<'a> {
}
}

impl<'a> DaoTestingSuite<TokenDaoExtra> for DaoTestingSuiteToken<'a> {
impl DaoTestingSuite<TokenDaoExtra> for DaoTestingSuiteToken<'_> {
fn base(&self) -> &DaoTestingSuiteBase {
self
}
Expand Down

0 comments on commit 7b8d966

Please sign in to comment.