Skip to content

Commit

Permalink
Clean up more clippy warnings (rust 1.75)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed May 6, 2024
1 parent e8a8516 commit 89e0d48
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contracts/consumer/converter/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub fn ibc_packet_receive(
_env: Env,
msg: IbcPacketReceiveMsg,
) -> Result<IbcReceiveResponse, ContractError> {
let packet: ProviderPacket = from_json(&msg.packet.data)?;
let packet: ProviderPacket = from_json(msg.packet.data)?;
let contract = ConverterContract::new();
let res = match packet {
ProviderPacket::Stake {
Expand Down
2 changes: 1 addition & 1 deletion contracts/consumer/remote-price-feed/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub fn ibc_packet_ack(
_env: Env,
msg: IbcPacketAckMsg,
) -> Result<IbcBasicResponse, ContractError> {
let ack: PriceFeedProviderAck = from_json(&msg.acknowledgement.data)?;
let ack: PriceFeedProviderAck = from_json(msg.acknowledgement.data)?;
let PriceFeedProviderAck::Update { time, twap } = ack;
let contract = RemotePriceFeedContract::new();
contract.update_twap(deps, time, twap)?;
Expand Down
2 changes: 1 addition & 1 deletion contracts/osmosis-price-provider/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub fn ibc_packet_receive(
pool_id,
base_asset,
quote_asset,
} = from_json(&msg.packet.data)?;
} = from_json(msg.packet.data)?;
let contract = OsmosisPriceProvider::new();

let time = env.block.time;
Expand Down
3 changes: 2 additions & 1 deletion contracts/provider/external-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ impl ExternalStakingContract<'_> {
/// In test code, this is called from `test_handle_slashing`.
/// In non-test code, this is being called from `ibc_packet_receive` (in the `ConsumerPacket::RemoveValidators`
/// handler)
#[allow(clippy::too_many_arguments)]
pub(crate) fn handle_slashing(
&self,
env: &Env,
Expand Down Expand Up @@ -1236,7 +1237,7 @@ pub mod cross_staking {
let owner = ctx.deps.api.addr_validate(&owner)?;

// parse and validate message
let msg: ReceiveVirtualStake = from_json(&msg)?;
let msg: ReceiveVirtualStake = from_json(msg)?;
if !self
.val_set
.is_active_validator(ctx.deps.storage, &msg.validator)?
Expand Down
4 changes: 2 additions & 2 deletions contracts/provider/external-staking/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn ibc_packet_receive(
// If a validator is in more than one of the events, the end result will depend on the
// processing order below.
let contract = ExternalStakingContract::new();
let packet: ConsumerPacket = from_json(&msg.packet.data)?;
let packet: ConsumerPacket = from_json(msg.packet.data)?;
let resp = match packet {
ConsumerPacket::ValsetUpdate {
height,
Expand Down Expand Up @@ -251,7 +251,7 @@ pub fn ibc_packet_timeout(
_env: Env,
msg: IbcPacketTimeoutMsg,
) -> Result<IbcBasicResponse, ContractError> {
let packet: ProviderPacket = from_json(&msg.packet.data)?;
let packet: ProviderPacket = from_json(msg.packet.data)?;
let contract = ExternalStakingContract::new();
let mut resp = IbcBasicResponse::new().add_attribute("action", "ibc_packet_timeout");
match packet {
Expand Down
2 changes: 1 addition & 1 deletion contracts/provider/native-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl NativeStakingContract<'_> {
// Associate staking proxy with owner address
let proxy_addr = Addr::unchecked(init_data.contract_address);
let owner_data: OwnerMsg =
from_json(&init_data.data.ok_or(ContractError::NoInstantiateData {})?)?;
from_json(init_data.data.ok_or(ContractError::NoInstantiateData {})?)?;
let owner_addr = deps.api.addr_validate(&owner_data.owner)?;
self.proxy_by_owner
.save(deps.storage, &owner_addr, &proxy_addr)?;
Expand Down
2 changes: 1 addition & 1 deletion contracts/provider/native-staking/src/local_staking_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl LocalStakingApi for NativeStakingContract<'_> {
let _paid = must_pay(&ctx.info, &cfg.denom)?;

// Parse message to find validator to stake on
let StakeMsg { validator } = from_json(&msg)?;
let StakeMsg { validator } = from_json(msg)?;

let owner_addr = ctx.deps.api.addr_validate(&owner)?;

Expand Down

0 comments on commit 89e0d48

Please sign in to comment.