Skip to content

Commit

Permalink
just lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ismellike committed Feb 16, 2025
1 parent 2f44e01 commit 23655d8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contracts/external/cw-payroll-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub fn instantiate_contract(
if ownership
.owner
.as_ref()
.map_or(false, |owner| *owner != sender)
.is_some_and(|owner| *owner != sender)
{
return Err(ContractError::Unauthorized {});
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/external/cw-payroll-factory/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct TokenIndexes<'a> {
pub recipient: MultiIndex<'a, String, VestingContract, String>,
}

impl<'a> IndexList<VestingContract> for TokenIndexes<'a> {
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/proposal/dao-proposal-condorcet/src/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn status(block: &BlockInfo, proposal: &Proposal, tally: &Tally) -> Status {
Status::Open => {
if proposal
.min_voting_period
.map_or(false, |min| !min.is_expired(block))
.is_some_and(|min| !min.is_expired(block))
{
return Status::Open;
}
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
7 changes: 3 additions & 4 deletions contracts/voting/dao-voting-onft-staked/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ pub fn execute_confirm_stake(
.iter()
.map(|token_id| -> StdResult<bool> {
// check if sender prepared
let prepared = PREPARED_ONFTS
.may_load(deps.storage, token_id.to_string())?
.map_or(false, |preparer| preparer == info.sender);
let prepared = PREPARED_ONFTS.may_load(deps.storage, token_id.to_string())?
== Some(info.sender.clone());

// check that NFT was transferred to this contract
let owner = query_onft_owner(deps.as_ref(), &config.onft_collection_id, token_id)?;
Expand Down Expand Up @@ -271,7 +270,7 @@ pub fn execute_cancel_stake(
}
} else {
for (token_id, owner, preparer) in token_ids_with_owners_and_preparers {
let is_preparer = preparer.as_ref().map_or(false, |p| *p == info.sender);
let is_preparer = preparer.as_ref().is_some_and(|p| *p == info.sender);
// only owner or preparer can cancel stake
if info.sender != owner && !is_preparer {
return Err(ContractError::NotPreparerNorOwner {});
Expand Down

0 comments on commit 23655d8

Please sign in to comment.