diff --git a/packages/std/src/serde_basic_type.rs b/packages/std/src/serde_basic_type.rs index 34e46a158f..1d9eb87876 100644 --- a/packages/std/src/serde_basic_type.rs +++ b/packages/std/src/serde_basic_type.rs @@ -41,6 +41,7 @@ impl SerializeForBasicType for String { } } +#[allow(dead_code)] pub fn serialize_to_bytes(value: &T) -> Vec { let mut buf = Vec::new(); value.serialize(&mut buf); diff --git a/packages/std/src/traits.rs b/packages/std/src/traits.rs index c4f0668e4b..e815a06f55 100644 --- a/packages/std/src/traits.rs +++ b/packages/std/src/traits.rs @@ -23,7 +23,7 @@ use crate::query::{ }; use crate::results::{ContractResult, Empty, SystemResult}; use crate::serde::{from_binary, to_binary, to_vec}; -use crate::serde_basic_type::deserialize_from_bytes; +use crate::serde_basic_type::{deserialize_from_bytes, SerializeForBasicType}; use crate::ContractInfoResponse; #[cfg(feature = "cosmwasm_1_3")] use crate::{DenomMetadata, PageRequest}; @@ -246,18 +246,17 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> { } pub fn query_ex(&self, request: &QueryRequest) -> StdResult { let raw = to_vec(request).map_err(|serialize_err| { - StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) + StdError::generic_err(format!("Serializing QueryRequest: {serialize_err}")) })?; match self.raw_query(&raw) { SystemResult::Err(system_err) => Err(StdError::generic_err(format!( - "Querier system error: {}", - system_err + "Querier system error: {system_err}" ))), SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err( - format!("Querier contract error: {}", contract_err), + format!("Querier contract error: {contract_err}"), )), SystemResult::Ok(ContractResult::Ok(value)) => { - Ok(deserialize_from_bytes((&value).to_vec()).unwrap()) + Ok(deserialize_from_bytes((value).to_vec()).unwrap()) } } }