Closed rnbguy closed 3 months ago
The following two cases are caught by clippy::shadow_unrelated. There are other cases, but these two cases are special as they are using the exact same value. So we can remove the shadowing and use the first binding directly.
clippy::shadow_unrelated
https://github.com/cosmos/ibc-rs/blob/e1f19af161878f9daf779aed0f19229f97d54814/ibc-core/ics04-channel/src/handler/acknowledgement.rs#L55-L59
is shadowed by
https://github.com/cosmos/ibc-rs/blob/e1f19af161878f9daf779aed0f19229f97d54814/ibc-core/ics04-channel/src/handler/acknowledgement.rs#L77-L81
Since msg is immutable, both are the same. We can remove second one and use the previous variable directly.
msg
https://github.com/cosmos/ibc-rs/blob/e1f19af161878f9daf779aed0f19229f97d54814/ibc-core/ics04-channel/src/handler/timeout.rs#L67-L68
https://github.com/cosmos/ibc-rs/blob/e1f19af161878f9daf779aed0f19229f97d54814/ibc-core/ics04-channel/src/handler/timeout.rs#L85-L89
Since packet is immutable, we can use previous one directly.
packet
<= 0.50.0
Bug Summary
The following two cases are caught by
clippy::shadow_unrelated
. There are other cases, but these two cases are special as they are using the exact same value. So we can remove the shadowing and use the first binding directly.https://github.com/cosmos/ibc-rs/blob/e1f19af161878f9daf779aed0f19229f97d54814/ibc-core/ics04-channel/src/handler/acknowledgement.rs#L55-L59
is shadowed by
https://github.com/cosmos/ibc-rs/blob/e1f19af161878f9daf779aed0f19229f97d54814/ibc-core/ics04-channel/src/handler/acknowledgement.rs#L77-L81
Since
msg
is immutable, both are the same. We can remove second one and use the previous variable directly.https://github.com/cosmos/ibc-rs/blob/e1f19af161878f9daf779aed0f19229f97d54814/ibc-core/ics04-channel/src/handler/timeout.rs#L67-L68
is shadowed by
https://github.com/cosmos/ibc-rs/blob/e1f19af161878f9daf779aed0f19229f97d54814/ibc-core/ics04-channel/src/handler/timeout.rs#L85-L89
Since
packet
is immutable, we can use previous one directly.Details
Version
<= 0.50.0