Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed May 31, 2024
1 parent 55836d1 commit 5a5acd0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,14 @@ pub fn _bond_all_tokens(

// we deduct pending claims from our account balance before reinvesting.
// if there is not enough funds, we just return a no-op
match update_item(deps.storage, KEY_TOTAL_SUPPLY, |mut supply: Supply| {
let updated = update_item(deps.storage, KEY_TOTAL_SUPPLY, |mut supply: Supply| {
balance.amount = balance.amount.checked_sub(supply.claims)?;
// this just triggers the "no op" case if we don't have min_withdrawal left to reinvest
balance.amount.checked_sub(invest.min_withdrawal)?;
supply.bonded += balance.amount;
Ok(supply)
}) {
});
match updated {
Ok(_) => {}
// if it is below the minimum, we do a no-op (do not revert other state from withdrawal)
Err(StdError::Overflow { .. }) => return Ok(Response::default()),
Expand Down
1 change: 1 addition & 0 deletions packages/std/src/testing/assertions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ mod tests {
)]
fn assert_approx_with_custom_panic_msg() {
let adjective = "extra";
#[allow(dead_code)]
#[derive(Debug)]
struct Foo(u32);
assert_approx_eq!(
Expand Down
1 change: 1 addition & 0 deletions packages/vm/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ fn save_wasm_to_disk(dir: impl Into<PathBuf>, wasm: &[u8]) -> VmResult<Checksum>
let mut file = OpenOptions::new()
.write(true)
.create(true)
.truncate(true)
.open(filepath)
.map_err(|e| VmError::cache_err(format!("Error opening Wasm file for writing: {e}")))?;
file.write_all(wasm)
Expand Down

0 comments on commit 5a5acd0

Please sign in to comment.