chore: update format! macro use to satisfy latest clippy version (#194)

This commit is contained in:
Louise Poole
2025-04-25 17:13:01 +02:00
committed by GitHub
parent 9740c92129
commit f29de67f1f
38 changed files with 1379 additions and 1698 deletions

View File

@@ -18,7 +18,7 @@ pub fn store_pools(pools_created: BlockEntityChanges, store: StoreSetIfNotExists
currency1: component_change.tokens[1].clone(),
created_tx_hash: change.tx.as_ref().unwrap().hash.clone(),
};
store.set_if_not_exists(0, format!("{}:{}", "pool", pool_address), &pool);
store.set_if_not_exists(0, format!("pool:{pool_address}"), &pool);
}
}
}

View File

@@ -50,7 +50,7 @@ fn log_to_event(
// We need to track initialization again to keep track of pool current tick, which is set on
// initialization and changed on swaps.
let pool_id = init.id.to_vec().to_hex();
let pool = pools_store.get_last(format!("{}:{}", "pool", &pool_id))?;
let pool = pools_store.get_last(format!("pool:{pool_id}"))?;
Some(PoolEvent {
log_ordinal: event.ordinal,
pool_id,
@@ -67,7 +67,7 @@ fn log_to_event(
})
} else if let Some(swap) = Swap::match_and_decode(event) {
let pool_id = swap.id.to_vec().to_hex();
let pool = pools_store.get_last(format!("{}:{}", "pool", &pool_id))?;
let pool = pools_store.get_last(format!("pool:{pool_id}"))?;
Some(PoolEvent {
log_ordinal: event.ordinal,
pool_id,
@@ -102,7 +102,7 @@ fn log_to_event(
// })
} else if let Some(modify_liquidity) = ModifyLiquidity::match_and_decode(event) {
let pool_id = modify_liquidity.id.to_vec().to_hex();
let pool = pools_store.get_last(format!("{}:{}", "pool", &pool_id))?;
let pool = pools_store.get_last(format!("pool:{pool_id}"))?;
Some(PoolEvent {
log_ordinal: event.ordinal,
pool_id,
@@ -124,7 +124,7 @@ fn log_to_event(
.id
.to_vec()
.to_hex();
let pool = pools_store.get_last(format!("{}:{}", "pool", &pool_id))?;
let pool = pools_store.get_last(format!("pool:{pool_id}"))?;
Some(PoolEvent {
log_ordinal: event.ordinal,
pool_id: pool_id.clone(),

View File

@@ -17,7 +17,7 @@ pub fn store_pool_current_sqrt_price(events: Events, store: StoreSetBigInt) {
.into_iter()
.filter_map(event_to_current_sqrt_price)
.for_each(|(pool, ordinal, new_tick_index)| {
store.set(ordinal, format!("pool:{0}", pool), &new_tick_index)
store.set(ordinal, format!("pool:{pool}"), &new_tick_index)
});
}

View File

@@ -14,7 +14,7 @@ pub fn store_pool_current_tick(events: Events, store: StoreSetInt64) {
.into_iter()
.filter_map(event_to_current_tick)
.for_each(|(pool, ordinal, new_tick_index)| {
store.set(ordinal, format!("pool:{0}", pool), &new_tick_index.into())
store.set(ordinal, format!("pool:{pool}"), &new_tick_index.into())
});
}
fn event_to_current_tick(event: PoolEvent) -> Option<(String, u64, i32)> {