Skip to content

Commit

Permalink
address linting issues from clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-c-child committed Apr 26, 2024
1 parent eb59c69 commit 5e50c1c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contracts/marketplace/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fn sell_name(
deps.as_ref(),
ask.clone(),
bid.amount,
bid.bidder.clone(),
bid.bidder,
&mut response,
)?;

Expand Down
4 changes: 2 additions & 2 deletions contracts/name-minter/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub fn execute_mint_and_list(
.unwrap_or(None);

let price = validate_payment(name.len(), &info, params.base_price.u128(), discount)?;
if price.clone().is_some() {
if price.is_some() {
charge_fees(
&mut res,
params.fair_burn_percent,
Expand Down Expand Up @@ -216,7 +216,7 @@ pub fn execute_mint_and_list(
.add_attribute("owner", sender)
.add_attribute(
"price",
price.unwrap_or(coin(0, NATIVE_DENOM)).amount.to_string(),
price.unwrap_or_else(|| coin(0, NATIVE_DENOM)).amount.to_string(),
);
Ok(res
.add_event(event)
Expand Down
2 changes: 1 addition & 1 deletion contracts/sg721-name/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ fn validate_address(deps: Deps, sender: &Addr, addr: Addr) -> Result<Addr, Contr
let collection_info: CollectionInfoResponse = deps
.querier
.query_wasm_smart(&addr, &sg721_base::msg::QueryMsg::CollectionInfo {})?;
if collection_info.creator == sender.to_string() {
if collection_info.creator == *sender.to_string() {
return Ok(addr);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ mod tests {

let msg = InstantiateMsg {
per_address_limit: PER_ADDRESS_LIMIT,
addresses: addrs.clone(),
addresses: addrs,
mint_discount_amount: None,
admin_list: Some(vec![CREATOR.to_string(), TEMP_ADMIN.to_string()]),
};
Expand Down Expand Up @@ -458,7 +458,7 @@ mod tests {
let msg = sg_name_minter::SgNameMinterExecuteMsg::AddWhitelist {
address: wl_addr.to_string(),
};
let res = app.execute_contract(Addr::unchecked(CREATOR), minter_addr.clone(), &msg, &[]);
let res = app.execute_contract(Addr::unchecked(CREATOR), minter_addr, &msg, &[]);
assert!(res.is_ok());

let res: bool = app
Expand Down

0 comments on commit 5e50c1c

Please sign in to comment.