Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Jan 22, 2025
1 parent 63f4b18 commit c73d7f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions contracts/external/cw-payroll-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ pub fn instantiate_contract(
) -> Result<Response, ContractError> {
// Check sender is contract owner if set
let ownership = cw_ownable::get_ownership(deps.storage)?;
if ownership
.owner
.as_ref()
.map_or(false, |owner| *owner != sender)
{
if ownership.owner != Some(sender) {
return Err(ContractError::Unauthorized {});
}

Expand Down
5 changes: 3 additions & 2 deletions contracts/voting/dao-voting-onft-staked/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ pub fn execute_confirm_stake(
// check if sender prepared
let prepared = PREPARED_ONFTS
.may_load(deps.storage, token_id.to_string())?
.map_or(false, |preparer| preparer == info.sender);
.as_ref()
== Some(&info.sender);

// 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 +272,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() == Some(&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 c73d7f3

Please sign in to comment.