Skip to content

Commit

Permalink
Merge pull request #254 from CosmWasm/update-to-rust-1.51.0
Browse files Browse the repository at this point in the history
Update to Rust v1.51.0
  • Loading branch information
maurolacy authored Mar 30, 2021
2 parents ce82ab2 + f017d57 commit 62ac2b7
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 121 deletions.
153 changes: 76 additions & 77 deletions .circleci/config.yml

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions contracts/cw1-subkeys/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 13 additions & 7 deletions contracts/cw1-whitelist/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand All @@ -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)
}
}
Expand All @@ -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)
}
}
Expand Down
16 changes: 9 additions & 7 deletions contracts/cw20-atomic-swap/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
12 changes: 8 additions & 4 deletions contracts/cw20-escrow/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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)
}

Expand Down
2 changes: 0 additions & 2 deletions contracts/cw20-ics20/src/ibc.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 0 additions & 2 deletions contracts/cw20-ics20/src/msg.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 0 additions & 2 deletions contracts/cw20-ics20/src/state.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 0 additions & 2 deletions packages/cw0/src/balance.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 0 additions & 2 deletions packages/cw0/src/expiration.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 0 additions & 2 deletions packages/cw2/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 0 additions & 2 deletions packages/cw20/src/helpers.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 0 additions & 2 deletions packages/cw20/src/msg.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 0 additions & 2 deletions packages/cw20/src/query.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 0 additions & 2 deletions packages/cw20/src/receiver.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
6 changes: 3 additions & 3 deletions packages/storage-plus/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ impl<T: Endian> From<Vec<u8>> for IntKey<T> {
}
}

impl<T: Endian> Into<Vec<u8>> for IntKey<T> {
fn into(self) -> Vec<u8> {
self.wrapped.0
impl<T: Endian> From<IntKey<T>> for Vec<u8> {
fn from(k: IntKey<T>) -> Vec<u8> {
k.wrapped.0
}
}

Expand Down

0 comments on commit 62ac2b7

Please sign in to comment.