Skip to content

Commit 763d852

Browse files
authored
Merge pull request #2067 from CosmWasm/clippy-1.77.0
Bump clippy to 1.77.0
2 parents 1d06b23 + 24cb39f commit 763d852

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ workflows:
7272
matrix:
7373
parameters:
7474
# Run with MSRV and some modern stable Rust
75-
rust-version: ["1.73.0", "1.76.0"]
75+
rust-version: ["1.73.0", "1.77.0"]
7676
- benchmarking:
7777
requires:
7878
- package_vm

contracts/staking/src/contract.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,14 @@ pub fn _bond_all_tokens(
322322

323323
// we deduct pending claims from our account balance before reinvesting.
324324
// if there is not enough funds, we just return a no-op
325-
match update_item(deps.storage, KEY_TOTAL_SUPPLY, |mut supply: Supply| {
325+
let updated = update_item(deps.storage, KEY_TOTAL_SUPPLY, |mut supply: Supply| {
326326
balance.amount = balance.amount.checked_sub(supply.claims)?;
327327
// this just triggers the "no op" case if we don't have min_withdrawal left to reinvest
328328
balance.amount.checked_sub(invest.min_withdrawal)?;
329329
supply.bonded += balance.amount;
330330
Ok(supply)
331-
}) {
331+
});
332+
match updated {
332333
Ok(_) => {}
333334
// if it is below the minimum, we do a no-op (do not revert other state from withdrawal)
334335
Err(StdError::Overflow { .. }) => return Ok(Response::default()),

packages/std/src/testing/assertions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ mod tests {
158158
)]
159159
fn assert_approx_with_custom_panic_msg() {
160160
let adjective = "extra";
161+
#[allow(dead_code)]
161162
#[derive(Debug)]
162163
struct Foo(u32);
163164
assert_approx_eq!(

packages/vm/src/cache.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ fn save_wasm_to_disk(dir: impl Into<PathBuf>, wasm: &[u8]) -> VmResult<Checksum>
522522
let mut file = OpenOptions::new()
523523
.write(true)
524524
.create(true)
525+
.truncate(true)
525526
.open(filepath)
526527
.map_err(|e| VmError::cache_err(format!("Error opening Wasm file for writing: {e}")))?;
527528
file.write_all(wasm)

packages/vm/src/conversion.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ mod tests {
4141
assert_eq!(to_u32(2147483647usize).unwrap(), 2147483647);
4242
assert_eq!(to_u32(2147483648usize).unwrap(), 2147483648);
4343
assert_eq!(to_u32(4294967295usize).unwrap(), 4294967295);
44-
44+
// Gate required for Rust 1.77.0 in Linux, possibly a Rust/clippy regression bug
45+
#[cfg(target_pointer_width = "64")]
4546
match to_u32(4294967296usize) {
4647
Err(VmError::ConversionErr {
4748
from_type,
@@ -130,6 +131,8 @@ mod tests {
130131
assert_eq!(ref_to_u32(&2147483647usize).unwrap(), 2147483647);
131132
assert_eq!(ref_to_u32(&2147483648usize).unwrap(), 2147483648);
132133
assert_eq!(ref_to_u32(&4294967295usize).unwrap(), 4294967295);
134+
// Gate required for Rust 1.77.0 in Linux, possibly a Rust/clippy regression bug
135+
#[cfg(target_pointer_width = "64")]
133136
match ref_to_u32(&4294967296usize).unwrap_err() {
134137
VmError::ConversionErr {
135138
from_type,

0 commit comments

Comments
 (0)