Skip to content

Commit

Permalink
satisfy clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Roznovjak committed Oct 2, 2024
1 parent 288705d commit 5f79fbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pallets/route-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ pub mod pallet {
ensure!(first_trade.amount_in <= max_amount_in, Error::<T>::TradingLimitReached);

let route_length = route.len();
let next_event_id = T::BatchIdProvider::next_id();
let next_event_id = T::BatchIdProvider::next_id().map_err(|_| ArithmeticError::Overflow)?;
for (trade_index, (trade_amount, trade)) in trade_amounts.iter().rev().zip(route).enumerate() {
Self::disable_ed_handling_for_insufficient_assets(route_length, trade_index, trade);
let user_balance_of_asset_out_before_trade =
Expand Down Expand Up @@ -493,7 +493,7 @@ impl<T: Config> Pallet<T> {
);

let route_length = route.len();
let next_event_id = T::BatchIdProvider::next_id();
let next_event_id = T::BatchIdProvider::next_id().map_err(|_| ArithmeticError::Overflow)?;
for (trade_index, (trade_amount, trade)) in trade_amounts.iter().zip(route.clone()).enumerate() {
Self::disable_ed_handling_for_insufficient_assets(route_length, trade_index, trade);

Expand Down

0 comments on commit 5f79fbb

Please sign in to comment.