diff --git a/.circleci/config.yml b/.circleci/config.yml index 6dec279c2..1b2583509 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ workflows: jobs: contract_cw1_subkeys: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw1-subkeys steps: - checkout: @@ -50,7 +50,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw1-subkeys-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw1-subkeys-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -72,11 +72,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw1-subkeys-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw1-subkeys-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw1_whitelist: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw1-whitelist steps: - checkout: @@ -86,7 +86,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw1-whitelist-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw1-whitelist-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -108,11 +108,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw1-whitelist-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw1-whitelist-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw20_atomic_swap: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw20-atomic-swap steps: - checkout: @@ -122,7 +122,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw20-atomic-swap-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw20-atomic-swap-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Add wasm32 target command: rustup target add wasm32-unknown-unknown @@ -147,11 +147,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw20-atomic-swap-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw20-atomic-swap-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw3_fixed_multisig: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw3-fixed-multisig steps: - checkout: @@ -161,7 +161,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw3-fixed-multisig-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw3-fixed-multisig-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -183,11 +183,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw3-fixed-multisig-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw3-fixed-multisig-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw3_flex_multisig: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw3-flex-multisig steps: - checkout: @@ -197,7 +197,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw3-flex-multisig-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw3-flex-multisig-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -219,11 +219,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw3-flex-multisig-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw3-flex-multisig-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw4_group: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw4-group steps: - checkout: @@ -233,7 +233,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw4-group-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw4-group-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -255,11 +255,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw4-group-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw4-group-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw4_stake: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw4-stake steps: - checkout: @@ -269,7 +269,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw4-stake-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw4-stake-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -291,11 +291,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw4-stake-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw4-stake-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw20_base: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw20-base steps: - checkout: @@ -305,7 +305,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw20-base-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw20-base-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -327,11 +327,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw20-base-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw20-base-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw20_bonding: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw20-bonding steps: - checkout: @@ -341,7 +341,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw20-bonding-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw20-bonding-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -363,11 +363,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw20-bonding-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw20-bonding-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw20_escrow: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw20-escrow steps: - checkout: @@ -377,7 +377,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw20-escrow-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw20-escrow-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -399,11 +399,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw20-escrow-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw20-escrow-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw20_ics20: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw20-ics20 steps: - checkout: @@ -413,7 +413,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw20-ics20-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw20-ics20-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -435,11 +435,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw20-ics20-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw20-ics20-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw20_staking: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw20-staking steps: - checkout: @@ -449,7 +449,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw20-staking-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw20-staking-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -471,11 +471,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw20-staking-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw20-staking-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} contract_cw721_base: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/contracts/cw721-base steps: - checkout: @@ -485,7 +485,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-cw721-base-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw721-base-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Unit Tests environment: @@ -507,11 +507,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-cw721-base-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw721-base-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_controllers: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/controllers steps: - checkout: @@ -521,7 +521,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-controllers:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-controllers:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -532,11 +532,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-controllers:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-controllers:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_cw0: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/cw0 steps: - checkout: @@ -546,7 +546,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-cw0:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-cw0:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -557,11 +557,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-cw0:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-cw0:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_cw1: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/cw1 steps: - checkout: @@ -571,7 +571,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-cw1:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-cw1:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -594,11 +594,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-cw1:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-cw1:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_cw2: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/cw2 steps: - checkout: @@ -608,7 +608,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-cw2:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-cw2:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -620,11 +620,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-cw2:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-cw2:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_cw3: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/cw3 steps: - checkout: @@ -634,7 +634,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-cw3:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-cw3:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -657,11 +657,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-cw3:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-cw3:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_cw4: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/cw4 steps: - checkout: @@ -671,7 +671,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-cw4:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-cw4:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -694,11 +694,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-cw4:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-cw4:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_cw20: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/cw20 steps: - checkout: @@ -708,7 +708,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-cw20:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-cw20:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -731,11 +731,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-cw20:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-cw20:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_cw721: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/cw721 steps: - checkout: @@ -745,7 +745,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-cw721:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-cw721:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -768,11 +768,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-cw721:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-cw721:1.51.0-{{ checksum "~/project/Cargo.lock" }} lint: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 steps: - checkout - run: @@ -780,7 +780,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-lint-rust:1.50.0-{{ checksum "Cargo.lock" }} + - cargocache-v2-lint-rust:1.51.0-{{ checksum "Cargo.lock" }} - run: name: Add rustfmt component command: rustup component add rustfmt @@ -792,15 +792,14 @@ jobs: command: cargo fmt -- --check - run: name: Clippy linting on workspace - # Silence false positive `field_reassing_with_default` (https://github.com/rust-lang/rust-clippy/issues/6545) - command: cargo clippy -- -D warnings -A clippy::field_reassign_with_default + command: cargo clippy -- -D warnings - save_cache: paths: - /usr/local/cargo/registry - target/debug/.fingerprint - target/debug/build - target/debug/deps - key: cargocache-v2-lint-rust:1.50.0-{{ checksum "Cargo.lock" }} + key: cargocache-v2-lint-rust:1.51.0-{{ checksum "Cargo.lock" }} # This runs one time on the top level to ensure all contracts compile properly into wasm. # We don't run the wasm build per contract build, and then reuse a lot of the same dependencies, so this speeds up CI time @@ -808,7 +807,7 @@ jobs: # We also sanity-check the resultant wasm files. wasm-build: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 steps: - checkout: path: ~/project @@ -817,7 +816,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-wasm-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-wasm-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Add wasm32 target command: rustup target add wasm32-unknown-unknown @@ -839,7 +838,7 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-wasm-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-wasm-rust:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Check wasm contracts command: | @@ -851,7 +850,7 @@ jobs: package_multi_test: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/multi-test steps: - checkout: @@ -861,7 +860,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-multi-test:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-multi-test:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -875,11 +874,11 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-multi-test:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-multi-test:1.51.0-{{ checksum "~/project/Cargo.lock" }} package_storage_plus: docker: - - image: rust:1.50.0 + - image: rust:1.51.0 working_directory: ~/project/packages/storage-plus steps: - checkout: @@ -889,7 +888,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-storage-plus:1.50.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-storage-plus:1.51.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -906,7 +905,7 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-storage-plus:1.50.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-storage-plus:1.51.0-{{ checksum "~/project/Cargo.lock" }} # This job roughly follows the instructions from https://circleci.com/blog/publishing-to-github-releases-via-circleci/ build_and_upload_contracts: diff --git a/contracts/cw1-subkeys/src/contract.rs b/contracts/cw1-subkeys/src/contract.rs index cf9c668d9..baea313a3 100644 --- a/contracts/cw1-subkeys/src/contract.rs +++ b/contracts/cw1-subkeys/src/contract.rs @@ -87,9 +87,11 @@ where let owner_raw = &deps.api.canonical_address(&info.sender)?; // this is the admin behavior (same as cw1-whitelist) if cfg.is_admin(owner_raw) { - let mut res = Response::default(); - res.messages = msgs; - res.attributes = vec![attr("action", "execute"), attr("owner", info.sender)]; + let res = Response { + messages: msgs, + attributes: vec![attr("action", "execute"), attr("owner", info.sender)], + ..Response::default() + }; Ok(res) } else { for msg in &msgs { diff --git a/contracts/cw1-whitelist/src/contract.rs b/contracts/cw1-whitelist/src/contract.rs index 4f99b0e67..3b9b6b2fe 100644 --- a/contracts/cw1-whitelist/src/contract.rs +++ b/contracts/cw1-whitelist/src/contract.rs @@ -74,9 +74,11 @@ where if !can_execute(deps.as_ref(), &info.sender)? { Err(ContractError::Unauthorized {}) } else { - let mut res = Response::default(); - res.messages = msgs; - res.attributes = vec![attr("action", "execute")]; + let res = Response { + messages: msgs, + attributes: vec![attr("action", "execute")], + ..Response::default() + }; Ok(res) } } @@ -93,8 +95,10 @@ pub fn execute_freeze( cfg.mutable = false; ADMIN_LIST.save(deps.storage, &cfg)?; - let mut res = Response::default(); - res.attributes = vec![attr("action", "freeze")]; + let res = Response { + attributes: vec![attr("action", "freeze")], + ..Response::default() + }; Ok(res) } } @@ -112,8 +116,10 @@ pub fn execute_update_admins( cfg.admins = map_canonical(deps.api, &admins)?; ADMIN_LIST.save(deps.storage, &cfg)?; - let mut res = Response::default(); - res.attributes = vec![attr("action", "update_admins")]; + let res = Response { + attributes: vec![attr("action", "update_admins")], + ..Response::default() + }; Ok(res) } } diff --git a/contracts/cw20-atomic-swap/src/contract.rs b/contracts/cw20-atomic-swap/src/contract.rs index f971b45de..870301882 100644 --- a/contracts/cw20-atomic-swap/src/contract.rs +++ b/contracts/cw20-atomic-swap/src/contract.rs @@ -116,13 +116,15 @@ pub fn execute_create( Some(_) => Err(ContractError::AlreadyExists {}), })?; - let mut res = Response::default(); - res.attributes = vec![ - attr("action", "create"), - attr("id", msg.id), - attr("hash", msg.hash), - attr("recipient", msg.recipient), - ]; + let res = Response { + attributes: vec![ + attr("action", "create"), + attr("id", msg.id), + attr("hash", msg.hash), + attr("recipient", msg.recipient), + ], + ..Response::default() + }; Ok(res) } diff --git a/contracts/cw20-escrow/src/contract.rs b/contracts/cw20-escrow/src/contract.rs index 039f945b6..4558f5767 100644 --- a/contracts/cw20-escrow/src/contract.rs +++ b/contracts/cw20-escrow/src/contract.rs @@ -112,8 +112,10 @@ pub fn execute_create( Some(_) => Err(ContractError::AlreadyInUse {}), })?; - let mut res = Response::default(); - res.attributes = vec![attr("action", "create"), attr("id", msg.id)]; + let res = Response { + attributes: vec![attr("action", "create"), attr("id", msg.id)], + ..Response::default() + }; Ok(res) } @@ -140,8 +142,10 @@ pub fn execute_top_up( // and save ESCROWS.save(deps.storage, &id, &escrow)?; - let mut res = Response::default(); - res.attributes = vec![attr("action", "top_up"), attr("id", id)]; + let res = Response { + attributes: vec![attr("action", "top_up"), attr("id", id)], + ..Response::default() + }; Ok(res) } diff --git a/contracts/cw20-ics20/src/ibc.rs b/contracts/cw20-ics20/src/ibc.rs index f1a9b761b..08bb165d3 100644 --- a/contracts/cw20-ics20/src/ibc.rs +++ b/contracts/cw20-ics20/src/ibc.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/contracts/cw20-ics20/src/msg.rs b/contracts/cw20-ics20/src/msg.rs index 6c4e1054b..bb0f8d940 100644 --- a/contracts/cw20-ics20/src/msg.rs +++ b/contracts/cw20-ics20/src/msg.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/contracts/cw20-ics20/src/state.rs b/contracts/cw20-ics20/src/state.rs index 217f8661a..1b1af2b52 100644 --- a/contracts/cw20-ics20/src/state.rs +++ b/contracts/cw20-ics20/src/state.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/packages/cw0/src/balance.rs b/packages/cw0/src/balance.rs index dff530569..745a792e9 100644 --- a/packages/cw0/src/balance.rs +++ b/packages/cw0/src/balance.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::ops; diff --git a/packages/cw0/src/expiration.rs b/packages/cw0/src/expiration.rs index b11e4adaa..e6cb1a5f9 100644 --- a/packages/cw0/src/expiration.rs +++ b/packages/cw0/src/expiration.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/packages/cw2/src/lib.rs b/packages/cw2/src/lib.rs index 7c0631a72..c3b5873c6 100644 --- a/packages/cw2/src/lib.rs +++ b/packages/cw2/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/packages/cw20/src/helpers.rs b/packages/cw20/src/helpers.rs index 3b4e70b78..c29bb31bd 100644 --- a/packages/cw20/src/helpers.rs +++ b/packages/cw20/src/helpers.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/packages/cw20/src/msg.rs b/packages/cw20/src/msg.rs index bb92b70ed..16cb874c1 100644 --- a/packages/cw20/src/msg.rs +++ b/packages/cw20/src/msg.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/packages/cw20/src/query.rs b/packages/cw20/src/query.rs index 910148b65..64bf695de 100644 --- a/packages/cw20/src/query.rs +++ b/packages/cw20/src/query.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/packages/cw20/src/receiver.rs b/packages/cw20/src/receiver.rs index fe0e2ed3c..80839ad50 100644 --- a/packages/cw20/src/receiver.rs +++ b/packages/cw20/src/receiver.rs @@ -1,5 +1,3 @@ -#![allow(clippy::field_reassign_with_default)] // see https://github.com/CosmWasm/cosmwasm/issues/685 - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/packages/storage-plus/src/keys.rs b/packages/storage-plus/src/keys.rs index 0384babd7..b3062dc7e 100644 --- a/packages/storage-plus/src/keys.rs +++ b/packages/storage-plus/src/keys.rs @@ -249,9 +249,9 @@ impl From> for IntKey { } } -impl Into> for IntKey { - fn into(self) -> Vec { - self.wrapped.0 +impl From> for Vec { + fn from(k: IntKey) -> Vec { + k.wrapped.0 } }