Repository: CosmWasm/cosmwasm
Pull request #1033 (2021-07-29 03:38:56)

Fully removed all generic implementations of Into<String>, 
and some others, as long as they do not have a return type involving the generic


Patch:
diff --git a/contracts/ibc-reflect-send/src/ibc.rs b/contracts/ibc-reflect-send/src/ibc.rs
index 82ce92102..b62d98583 100644
--- a/contracts/ibc-reflect-send/src/ibc.rs
+++ b/contracts/ibc-reflect-send/src/ibc.rs
@@ -269,7 +269,7 @@ mod tests {
         };
     }
 
-    fn who_am_i_response<T: Into<String>>(deps: DepsMut, channel_id: &str, account: T) {
+    fn who_am_i_response(deps: DepsMut, channel_id: &str, account: impl Into<String>) {
         let packet = PacketMsg::WhoAmI {};
         let response = AcknowledgementMsg::Ok(WhoAmIResponse {
             account: account.into(),
diff --git a/contracts/ibc-reflect/src/contract.rs b/contracts/ibc-reflect/src/contract.rs
index a980e1af0..a4493f7f4 100644
--- a/contracts/ibc-reflect/src/contract.rs
+++ b/contracts/ibc-reflect/src/contract.rs
@@ -219,7 +219,7 @@ pub fn migrate(_deps: DepsMut, _env: Env, _msg: Empty) -> StdResult<Response> {
 }
 
 // this encode an error or error message into a proper acknowledgement to the recevier
-fn encode_ibc_error<T: Into<String>>(msg: T) -> Binary {
+fn encode_ibc_error(msg: impl Into<String>) -> Binary {
     // this cannot error, unwrap to keep the interface simple
     to_binary(&AcknowledgementMsg::<()>::Err(msg.into())).unwrap()
 }
@@ -367,7 +367,7 @@ mod tests {
 
     // connect will run through the entire handshake to set up a proper connect and
     // save the account (tested in detail in `proper_handshake_flow`)
-    fn connect<T: Into<String>>(mut deps: DepsMut, channel_id: &str, account: T) {
+    fn connect(mut deps: DepsMut, channel_id: &str, account: impl Into<String>) {
         let account: String = account.into();
 
         let handshake_open = mock_ibc_channel_open_init(channel_id, IbcOrder::Ordered, IBC_VERSION);
diff --git a/contracts/staking/src/contract.rs b/contracts/staking/src/contract.rs
index 8e29c7203..99849ce1f 100644
--- a/contracts/staking/src/contract.rs
+++ b/contracts/staking/src/contract.rs
@@ -103,7 +103,7 @@ pub fn transfer(
 
 // get_bonded returns the total amount of delegations from contract
 // it ensures they are all the same denom
-fn get_bonded<U: Into<String>>(querier: &QuerierWrapper, contract_addr: U) -> StdResult<Uint128> {
+fn get_bonded(querier: &QuerierWrapper, contract_addr: impl Into<String>) -> StdResult<Uint128> {
     let bonds = querier.query_all_delegations(contract_addr)?;
     if bonds.is_empty() {
         return Ok(Uint128::new(0));
diff --git a/packages/crypto/src/errors.rs b/packages/crypto/src/errors.rs
index 3244187ef..b48f154ed 100644
--- a/packages/crypto/src/errors.rs
+++ b/packages/crypto/src/errors.rs
@@ -42,7 +42,7 @@ pub enum CryptoError {
 }
 
 impl CryptoError {
-    pub fn batch_err<S: Into<String>>(msg: S) -> Self {
+    pub fn batch_err(msg: impl Into<String>) -> Self {
         CryptoError::BatchErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -50,7 +50,7 @@ impl CryptoError {
         }
     }
 
-    pub fn generic_err<S: Into<String>>(msg: S) -> Self {
+    pub fn generic_err(msg: impl Into<String>) -> Self {
         CryptoError::GenericErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
diff --git a/packages/std/src/addresses.rs b/packages/std/src/addresses.rs
index 47aade374..0a8cd6f26 100644
--- a/packages/std/src/addresses.rs
+++ b/packages/std/src/addresses.rs
@@ -44,7 +44,7 @@ impl Addr {
     /// let address = Addr::unchecked("foobar");
     /// assert_eq!(address, "foobar");
     /// ```
-    pub fn unchecked<T: Into<String>>(input: T) -> Addr {
+    pub fn unchecked(input: impl Into<String>) -> Addr {
         Addr(input.into())
     }
 
diff --git a/packages/std/src/coins.rs b/packages/std/src/coins.rs
index 2b05d67cd..a84799b3d 100644
--- a/packages/std/src/coins.rs
+++ b/packages/std/src/coins.rs
@@ -11,7 +11,7 @@ pub struct Coin {
 }
 
 impl Coin {
-    pub fn new<S: Into<String>>(amount: u128, denom: S) -> Self {
+    pub fn new(amount: u128, denom: impl Into<String>) -> Self {
         Coin {
             amount: Uint128::new(amount),
             denom: denom.into(),
@@ -46,7 +46,7 @@ impl fmt::Display for Coin {
 ///   amount: tip,
 /// })];
 /// ```
-pub fn coins<S: Into<String>>(amount: u128, denom: S) -> Vec<Coin> {
+pub fn coins(amount: u128, denom: impl Into<String>) -> Vec<Coin> {
     vec![coin(amount, denom)]
 }
 
@@ -70,7 +70,7 @@ pub fn coins<S: Into<String>>(amount: u128, denom: S) -> Vec<Coin> {
 ///     amount: tip,
 /// })];
 /// ```
-pub fn coin<S: Into<String>>(amount: u128, denom: S) -> Coin {
+pub fn coin(amount: u128, denom: impl Into<String>) -> Coin {
     Coin::new(amount, denom)
 }
 
diff --git a/packages/std/src/errors/std_error.rs b/packages/std/src/errors/std_error.rs
index ba61a0532..4abfc7003 100644
--- a/packages/std/src/errors/std_error.rs
+++ b/packages/std/src/errors/std_error.rs
@@ -114,7 +114,7 @@ impl StdError {
         }
     }
 
-    pub fn generic_err<S: Into<String>>(msg: S) -> Self {
+    pub fn generic_err(msg: impl Into<String>) -> Self {
         StdError::GenericErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -122,7 +122,7 @@ impl StdError {
         }
     }
 
-    pub fn invalid_base64<S: ToString>(msg: S) -> Self {
+    pub fn invalid_base64(msg: impl ToString) -> Self {
         StdError::InvalidBase64 {
             msg: msg.to_string(),
             #[cfg(feature = "backtraces")]
@@ -140,7 +140,7 @@ impl StdError {
         }
     }
 
-    pub fn invalid_utf8<S: ToString>(msg: S) -> Self {
+    pub fn invalid_utf8(msg: impl ToString) -> Self {
         StdError::InvalidUtf8 {
             msg: msg.to_string(),
             #[cfg(feature = "backtraces")]
@@ -148,7 +148,7 @@ impl StdError {
         }
     }
 
-    pub fn not_found<S: Into<String>>(kind: S) -> Self {
+    pub fn not_found(kind: impl Into<String>) -> Self {
         StdError::NotFound {
             kind: kind.into(),
             #[cfg(feature = "backtraces")]
@@ -156,7 +156,7 @@ impl StdError {
         }
     }
 
-    pub fn parse_err<T: Into<String>, M: ToString>(target: T, msg: M) -> Self {
+    pub fn parse_err(target: impl Into<String>, msg: impl ToString) -> Self {
         StdError::ParseErr {
             target_type: target.into(),
             msg: msg.to_string(),
@@ -165,7 +165,7 @@ impl StdError {
         }
     }
 
-    pub fn serialize_err<S: Into<String>, M: ToString>(source: S, msg: M) -> Self {
+    pub fn serialize_err(source: impl Into<String>, msg: impl ToString) -> Self {
         StdError::SerializeErr {
             source_type: source.into(),
             msg: msg.to_string(),
@@ -462,7 +462,7 @@ pub struct DivideByZeroError {
 }
 
 impl DivideByZeroError {
-    pub fn new<U: ToString>(operand: U) -> Self {
+    pub fn new(operand: impl ToString) -> Self {
         Self {
             operand: operand.to_string(),
         }
diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs
index c2af6213a..8ab80c840 100644
--- a/packages/std/src/ibc.rs
+++ b/packages/std/src/ibc.rs
@@ -233,11 +233,11 @@ pub struct IbcAcknowledgement {
 }
 
 impl IbcAcknowledgement {
-    pub fn new<T: Into<Binary>>(data: T) -> Self {
+    pub fn new(data: impl Into<Binary>) -> Self {
         IbcAcknowledgement { data: data.into() }
     }
 
-    pub fn encode_json<T: Serialize>(data: &T) -> StdResult<Self> {
+    pub fn encode_json(data: &impl Serialize) -> StdResult<Self> {
         Ok(IbcAcknowledgement {
             data: to_binary(data)?,
         })
diff --git a/packages/std/src/mock.rs b/packages/std/src/mock.rs
index 498f64441..70eb6f688 100644
--- a/packages/std/src/mock.rs
+++ b/packages/std/src/mock.rs
@@ -303,9 +303,9 @@ pub fn mock_ibc_channel_close_confirm(
 /// Creates a IbcPacketReceiveMsg for testing ibc_packet_receive. You set a few key parameters that are
 /// often parsed. If you want to set more, use this as a default and mutate other fields
 #[cfg(feature = "stargate")]
-pub fn mock_ibc_packet_recv<T: Serialize>(
+pub fn mock_ibc_packet_recv(
     my_channel_id: &str,
-    data: &T,
+    data: &impl Serialize,
 ) -> StdResult<IbcPacketReceiveMsg> {
     Ok(IbcPacketReceiveMsg::new(IbcPacket {
         data: to_binary(data)?,
@@ -330,7 +330,7 @@ pub fn mock_ibc_packet_recv<T: Serialize>(
 /// often parsed. If you want to set more, use this as a default and mutate other fields.
 /// The difference from mock_ibc_packet_recv is if `my_channel_id` is src or dest.
 #[cfg(feature = "stargate")]
-fn mock_ibc_packet<T: Serialize>(my_channel_id: &str, data: &T) -> StdResult<IbcPacket> {
+fn mock_ibc_packet(my_channel_id: &str, data: &impl Serialize) -> StdResult<IbcPacket> {
     Ok(IbcPacket {
         data: to_binary(data)?,
         src: IbcEndpoint {
@@ -354,9 +354,9 @@ fn mock_ibc_packet<T: Serialize>(my_channel_id: &str, data: &T) -> StdResult<Ibc
 /// often parsed. If you want to set more, use this as a default and mutate other fields.
 /// The difference from mock_ibc_packet_recv is if `my_channel_id` is src or dest.
 #[cfg(feature = "stargate")]
-pub fn mock_ibc_packet_ack<T: Serialize>(
+pub fn mock_ibc_packet_ack(
     my_channel_id: &str,
-    data: &T,
+    data: &impl Serialize,
     ack: IbcAcknowledgement,
 ) -> StdResult<IbcPacketAckMsg> {
     let packet = mock_ibc_packet(my_channel_id, data)?;
@@ -368,9 +368,9 @@ pub fn mock_ibc_packet_ack<T: Serialize>(
 /// often parsed. If you want to set more, use this as a default and mutate other fields.
 /// The difference from mock_ibc_packet_recv is if `my_channel_id` is src or dest./
 #[cfg(feature = "stargate")]
-pub fn mock_ibc_packet_timeout<T: Serialize>(
+pub fn mock_ibc_packet_timeout(
     my_channel_id: &str,
-    data: &T,
+    data: &impl Serialize,
 ) -> StdResult<IbcPacketTimeoutMsg> {
     mock_ibc_packet(my_channel_id, data).map(IbcPacketTimeoutMsg::new)
 }
@@ -411,9 +411,9 @@ impl<C: DeserializeOwned> MockQuerier<C> {
     }
 
     // set a new balance for the given address and return the old balance
-    pub fn update_balance<U: Into<String>>(
+    pub fn update_balance(
         &mut self,
-        addr: U,
+        addr: impl Into<String>,
         balance: Vec<Coin>,
     ) -> Option<Vec<Coin>> {
         self.bank.balances.insert(addr.into(), balance)
@@ -1112,9 +1112,9 @@ mod tests {
 
     #[cfg(feature = "staking")]
     // gets delegators from query or panic
-    fn get_all_delegators<U: Into<String>>(
+    fn get_all_delegators(
         staking: &StakingQuerier,
-        delegator: U,
+        delegator: impl Into<String>,
     ) -> Vec<Delegation> {
         let raw = staking
             .query(&StakingQuery::AllDelegations {
@@ -1128,10 +1128,10 @@ mod tests {
 
     #[cfg(feature = "staking")]
     // gets full delegators from query or panic
-    fn get_delegator<U: Into<String>, V: Into<String>>(
+    fn get_delegator(
         staking: &StakingQuerier,
-        delegator: U,
-        validator: V,
+        delegator: impl Into<String>,
+        validator: impl Into<String>,
     ) -> Option<FullDelegation> {
         let raw = staking
             .query(&StakingQuery::Delegation {
diff --git a/packages/std/src/results/cosmos_msg.rs b/packages/std/src/results/cosmos_msg.rs
index 7a67e3be2..639890ac3 100644
--- a/packages/std/src/results/cosmos_msg.rs
+++ b/packages/std/src/results/cosmos_msg.rs
@@ -183,15 +183,12 @@ pub enum VoteOption {
 /// Shortcut helper as the construction of WasmMsg::Instantiate can be quite verbose in contract code.
 ///
 /// When using this, `admin` is always unset. If you need more flexibility, create the message directly.
-pub fn wasm_instantiate<T>(
+pub fn wasm_instantiate(
     code_id: u64,
-    msg: &T,
+    msg: &impl Serialize,
     funds: Vec<Coin>,
     label: String,
-) -> StdResult<WasmMsg>
-where
-    T: Serialize,
-{
+) -> StdResult<WasmMsg> {
     let payload = to_binary(msg)?;
     Ok(WasmMsg::Instantiate {
         admin: None,
@@ -203,11 +200,11 @@ where
 }
 
 /// Shortcut helper as the construction of WasmMsg::Instantiate can be quite verbose in contract code
-pub fn wasm_execute<T, U>(contract_addr: T, msg: &U, funds: Vec<Coin>) -> StdResult<WasmMsg>
-where
-    T: Into<String>,
-    U: Serialize,
-{
+pub fn wasm_execute(
+    contract_addr: impl Into<String>,
+    msg: &impl Serialize,
+    funds: Vec<Coin>,
+) -> StdResult<WasmMsg> {
     let payload = to_binary(msg)?;
     Ok(WasmMsg::Execute {
         contract_addr: contract_addr.into(),
diff --git a/packages/std/src/results/submessages.rs b/packages/std/src/results/submessages.rs
index c7b3163f9..e1ad9dcf4 100644
--- a/packages/std/src/results/submessages.rs
+++ b/packages/std/src/results/submessages.rs
@@ -49,7 +49,7 @@ where
     T: Clone + fmt::Debug + PartialEq + JsonSchema,
 {
     /// new creates a "fire and forget" message with the pre-0.14 semantics
-    pub fn new<M: Into<CosmosMsg<T>>>(msg: M) -> Self {
+    pub fn new(msg: impl Into<CosmosMsg<T>>) -> Self {
         SubMsg {
             id: UNUSED_MSG_ID,
             msg: msg.into(),
@@ -59,17 +59,17 @@ where
     }
 
     /// create a `SubMsg` that will provide a `reply` with the given id if the message returns `Ok`
-    pub fn reply_on_success<M: Into<CosmosMsg<T>>>(msg: M, id: u64) -> Self {
+    pub fn reply_on_success(msg: impl Into<CosmosMsg<T>>, id: u64) -> Self {
         Self::reply_on(msg.into(), id, ReplyOn::Success)
     }
 
     /// create a `SubMsg` that will provide a `reply` with the given id if the message returns `Err`
-    pub fn reply_on_error<M: Into<CosmosMsg<T>>>(msg: M, id: u64) -> Self {
+    pub fn reply_on_error(msg: impl Into<CosmosMsg<T>>, id: u64) -> Self {
         Self::reply_on(msg.into(), id, ReplyOn::Error)
     }
 
     /// create a `SubMsg` that will always provide a `reply` with the given id
-    pub fn reply_always<M: Into<CosmosMsg<T>>>(msg: M, id: u64) -> Self {
+    pub fn reply_always(msg: impl Into<CosmosMsg<T>>, id: u64) -> Self {
         Self::reply_on(msg.into(), id, ReplyOn::Always)
     }
 
diff --git a/packages/std/src/traits.rs b/packages/std/src/traits.rs
index 2bbb749a9..bb9ae0f78 100644
--- a/packages/std/src/traits.rs
+++ b/packages/std/src/traits.rs
@@ -184,10 +184,10 @@ impl<'a> QuerierWrapper<'a> {
         }
     }
 
-    pub fn query_balance<U: Into<String>, V: Into<String>>(
+    pub fn query_balance(
         &self,
-        address: U,
-        denom: V,
+        address: impl Into<String>,
+        denom: impl Into<String>,
     ) -> StdResult<Coin> {
         let request = BankQuery::Balance {
             address: address.into(),
@@ -198,7 +198,7 @@ impl<'a> QuerierWrapper<'a> {
         Ok(res.amount)
     }
 
-    pub fn query_all_balances<U: Into<String>>(&self, address: U) -> StdResult<Vec<Coin>> {
+    pub fn query_all_balances(&self, address: impl Into<String>) -> StdResult<Vec<Coin>> {
         let request = BankQuery::AllBalances {
             address: address.into(),
         }
@@ -209,10 +209,10 @@ impl<'a> QuerierWrapper<'a> {
 
     // this queries another wasm contract. You should know a priori the proper types for T and U
     // (response and request) based on the contract API
-    pub fn query_wasm_smart<T: DeserializeOwned, U: Serialize, V: Into<String>>(
+    pub fn query_wasm_smart<T: DeserializeOwned>(
         &self,
-        contract_addr: V,
-        msg: &U,
+        contract_addr: impl Into<String>,
+        msg: &impl Serialize,
     ) -> StdResult<T> {
         let request = WasmQuery::Smart {
             contract_addr: contract_addr.into(),
@@ -229,10 +229,10 @@ impl<'a> QuerierWrapper<'a> {
     //
     // Similar return value to Storage.get(). Returns Some(val) or None if the data is there.
     // It only returns error on some runtime issue, not on any data cases.
-    pub fn query_wasm_raw<T: Into<String>, U: Into<Binary>>(
+    pub fn query_wasm_raw(
         &self,
-        contract_addr: T,
-        key: U,
+        contract_addr: impl Into<String>,
+        key: impl Into<Binary>,
     ) -> StdResult<Option<Vec<u8>>> {
         let request: QueryRequest<Empty> = WasmQuery::Raw {
             contract_addr: contract_addr.into(),
@@ -270,7 +270,7 @@ impl<'a> QuerierWrapper<'a> {
     }
 
     #[cfg(feature = "staking")]
-    pub fn query_validator<U: Into<String>>(&self, address: U) -> StdResult<Option<Validator>> {
+    pub fn query_validator(&self, address: impl Into<String>) -> StdResult<Option<Validator>> {
         let request = StakingQuery::Validator {
             address: address.into(),
         }
@@ -287,9 +287,9 @@ impl<'a> QuerierWrapper<'a> {
     }
 
     #[cfg(feature = "staking")]
-    pub fn query_all_delegations<U: Into<String>>(
+    pub fn query_all_delegations(
         &self,
-        delegator: U,
+        delegator: impl Into<String>,
     ) -> StdResult<Vec<Delegation>> {
         let request = StakingQuery::AllDelegations {
             delegator: delegator.into(),
@@ -300,10 +300,10 @@ impl<'a> QuerierWrapper<'a> {
     }
 
     #[cfg(feature = "staking")]
-    pub fn query_delegation<U: Into<String>, V: Into<String>>(
+    pub fn query_delegation(
         &self,
-        delegator: U,
-        validator: V,
+        delegator: impl Into<String>,
+        validator: impl Into<String>,
     ) -> StdResult<Option<FullDelegation>> {
         let request = StakingQuery::Delegation {
             delegator: delegator.into(),
diff --git a/packages/vm/src/backend.rs b/packages/vm/src/backend.rs
index 11771bc36..238ac5f4f 100644
--- a/packages/vm/src/backend.rs
+++ b/packages/vm/src/backend.rs
@@ -187,7 +187,7 @@ impl BackendError {
         BackendError::OutOfGas {}
     }
 
-    pub fn unknown<S: ToString>(msg: S) -> Self {
+    pub fn unknown(msg: impl ToString) -> Self {
         BackendError::Unknown {
             msg: Some(msg.to_string()),
         }
@@ -198,7 +198,7 @@ impl BackendError {
         BackendError::Unknown { msg: None }
     }
 
-    pub fn user_err<S: ToString>(msg: S) -> Self {
+    pub fn user_err(msg: impl ToString) -> Self {
         BackendError::UserErr {
             msg: msg.to_string(),
         }
diff --git a/packages/vm/src/cache.rs b/packages/vm/src/cache.rs
index 310bdf38c..da9ffac06 100644
--- a/packages/vm/src/cache.rs
+++ b/packages/vm/src/cache.rs
@@ -313,7 +313,7 @@ where
 /// save stores the wasm code in the given directory and returns an ID for lookup.
 /// It will create the directory if it doesn't exist.
 /// Saving the same byte code multiple times is allowed.
-fn save_wasm_to_disk<P: Into<PathBuf>>(dir: P, wasm: &[u8]) -> VmResult<Checksum> {
+fn save_wasm_to_disk(dir: impl Into<PathBuf>, wasm: &[u8]) -> VmResult<Checksum> {
     // calculate filename
     let checksum = Checksum::generate(wasm);
     let filename = checksum.to_hex();
@@ -333,7 +333,7 @@ fn save_wasm_to_disk<P: Into<PathBuf>>(dir: P, wasm: &[u8]) -> VmResult<Checksum
     Ok(checksum)
 }
 
-fn load_wasm_from_disk<P: Into<PathBuf>>(dir: P, checksum: &Checksum) -> VmResult<Vec<u8>> {
+fn load_wasm_from_disk(dir: impl Into<PathBuf>, checksum: &Checksum) -> VmResult<Vec<u8>> {
     // this requires the directory and file to exist
     let path = dir.into().join(checksum.to_hex());
     let mut file = File::open(path)
diff --git a/packages/vm/src/errors/communication_error.rs b/packages/vm/src/errors/communication_error.rs
index ccaa1cfa7..a5fb88e0e 100644
--- a/packages/vm/src/errors/communication_error.rs
+++ b/packages/vm/src/errors/communication_error.rs
@@ -37,7 +37,7 @@ pub enum CommunicationError {
 }
 
 impl CommunicationError {
-    pub(crate) fn deref_err<S: Into<String>>(offset: u32, msg: S) -> Self {
+    pub(crate) fn deref_err(offset: u32, msg: impl Into<String>) -> Self {
         CommunicationError::DerefErr {
             offset,
             msg: msg.into(),
@@ -50,7 +50,7 @@ impl CommunicationError {
     }
 
     #[allow(dead_code)]
-    pub(crate) fn invalid_utf8<S: ToString>(msg: S) -> Self {
+    pub(crate) fn invalid_utf8(msg: impl ToString) -> Self {
         CommunicationError::InvalidUtf8 {
             msg: msg.to_string(),
         }
diff --git a/packages/vm/src/errors/vm_error.rs b/packages/vm/src/errors/vm_error.rs
index b9bb506c7..80d969328 100644
--- a/packages/vm/src/errors/vm_error.rs
+++ b/packages/vm/src/errors/vm_error.rs
@@ -150,7 +150,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn cache_err<S: Into<String>>(msg: S) -> Self {
+    pub(crate) fn cache_err(msg: impl Into<String>) -> Self {
         VmError::CacheErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -158,7 +158,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn compile_err<S: Into<String>>(msg: S) -> Self {
+    pub(crate) fn compile_err(msg: impl Into<String>) -> Self {
         VmError::CompileErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -166,10 +166,10 @@ impl VmError {
         }
     }
 
-    pub(crate) fn conversion_err<S: Into<String>, T: Into<String>, U: Into<String>>(
-        from_type: S,
-        to_type: T,
-        input: U,
+    pub(crate) fn conversion_err(
+        from_type: impl Into<String>,
+        to_type: impl Into<String>,
+        input: impl Into<String>,
     ) -> Self {
         VmError::ConversionErr {
             from_type: from_type.into(),
@@ -195,7 +195,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn generic_err<S: Into<String>>(msg: S) -> Self {
+    pub(crate) fn generic_err(msg: impl Into<String>) -> Self {
         VmError::GenericErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -203,7 +203,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn instantiation_err<S: Into<String>>(msg: S) -> Self {
+    pub(crate) fn instantiation_err(msg: impl Into<String>) -> Self {
         VmError::InstantiationErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -218,7 +218,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn parse_err<T: Into<String>, M: Display>(target: T, msg: M) -> Self {
+    pub(crate) fn parse_err(target: impl Into<String>, msg: impl Display) -> Self {
         VmError::ParseErr {
             target_type: target.into(),
             msg: msg.to_string(),
@@ -236,7 +236,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn serialize_err<S: Into<String>, M: Display>(source: S, msg: M) -> Self {
+    pub(crate) fn serialize_err(source: impl Into<String>, msg: impl Display) -> Self {
         VmError::SerializeErr {
             source_type: source.into(),
             msg: msg.to_string(),
@@ -245,7 +245,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn resolve_err<S: Into<String>>(msg: S) -> Self {
+    pub(crate) fn resolve_err(msg: impl Into<String>) -> Self {
         VmError::ResolveErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -253,8 +253,8 @@ impl VmError {
         }
     }
 
-    pub(crate) fn result_mismatch<S: Into<String>>(
-        function_name: S,
+    pub(crate) fn result_mismatch(
+        function_name: impl Into<String>,
         expected: usize,
         actual: usize,
     ) -> Self {
@@ -267,7 +267,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn runtime_err<S: Into<String>>(msg: S) -> Self {
+    pub(crate) fn runtime_err(msg: impl Into<String>) -> Self {
         VmError::RuntimeErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -275,7 +275,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn static_validation_err<S: Into<String>>(msg: S) -> Self {
+    pub(crate) fn static_validation_err(msg: impl Into<String>) -> Self {
         VmError::StaticValidationErr {
             msg: msg.into(),
             #[cfg(feature = "backtraces")]
@@ -283,7 +283,7 @@ impl VmError {
         }
     }
 
-    pub(crate) fn uninitialized_context_data<S: Into<String>>(kind: S) -> Self {
+    pub(crate) fn uninitialized_context_data(kind: impl Into<String>) -> Self {
         VmError::UninitializedContextData {
             kind: kind.into(),
             #[cfg(feature = "backtraces")]
diff --git a/packages/vm/src/modules/file_system_cache.rs b/packages/vm/src/modules/file_system_cache.rs
index 036c61cad..dcd25fd48 100644
--- a/packages/vm/src/modules/file_system_cache.rs
+++ b/packages/vm/src/modules/file_system_cache.rs
@@ -31,7 +31,7 @@ impl FileSystemCache {
     ///
     /// This method is unsafe because there's no way to ensure the artifacts
     /// stored in this cache haven't been corrupted or tampered with.
-    pub unsafe fn new<P: Into<PathBuf>>(path: P) -> io::Result<Self> {
+    pub unsafe fn new(path: impl Into<PathBuf>) -> io::Result<Self> {
         let path: PathBuf = path.into();
         if path.exists() {
             let metadata = path.metadata()?;


Test patch:
diff --git a/contracts/ibc-reflect-send/tests/integration.rs b/contracts/ibc-reflect-send/tests/integration.rs
index 7ee192fdf..79d986011 100644
--- a/contracts/ibc-reflect-send/tests/integration.rs
+++ b/contracts/ibc-reflect-send/tests/integration.rs
@@ -76,10 +76,10 @@ fn connect(deps: &mut Instance<MockApi, MockStorage, MockQuerier>, channel_id: &
     };
 }
 
-fn who_am_i_response<T: Into<String>>(
+fn who_am_i_response(
     deps: &mut Instance<MockApi, MockStorage, MockQuerier>,
     channel_id: &str,
-    account: T,
+    account: impl Into<String>,
 ) {
     let packet = PacketMsg::WhoAmI {};
     let response = AcknowledgementMsg::Ok(WhoAmIResponse {
diff --git a/contracts/ibc-reflect/tests/integration.rs b/contracts/ibc-reflect/tests/integration.rs
index 2ac0cbed5..b9adb9f9a 100644
--- a/contracts/ibc-reflect/tests/integration.rs
+++ b/contracts/ibc-reflect/tests/integration.rs
@@ -72,10 +72,10 @@ fn fake_events(reflect_addr: &str) -> Vec<Event> {
 
 // connect will run through the entire handshake to set up a proper connect and
 // save the account (tested in detail in `proper_handshake_flow`)
-fn connect<T: Into<String>>(
+fn connect(
     deps: &mut Instance<MockApi, MockStorage, MockQuerier>,
     channel_id: &str,
-    account: T,
+    account: impl Into<String>,
 ) {
     let account: String = account.into();
     // first we try to open with a valid handshake
diff --git a/packages/vm/src/testing/querier.rs b/packages/vm/src/testing/querier.rs
index a6d6c36bb..4e9b8bbcd 100644
--- a/packages/vm/src/testing/querier.rs
+++ b/packages/vm/src/testing/querier.rs
@@ -28,9 +28,9 @@ impl<C: CustomQuery + DeserializeOwned> MockQuerier<C> {
     }
 
     // set a new balance for the given address and return the old balance
-    pub fn update_balance<U: Into<String>>(
+    pub fn update_balance(
         &mut self,
-        addr: U,
+        addr: impl Into<String>,
         balance: Vec<Coin>,
     ) -> Option<Vec<Coin>> {
         self.querier.update_balance(addr, balance)