style(amm): cargo fmt

This commit is contained in:
Andrea Franz 2026-07-23 14:18:33 +02:00 committed by r4bbit
parent cf92e5d111
commit f1fc061664
3 changed files with 6 additions and 5 deletions

View File

@ -73,7 +73,10 @@ pub unsafe extern "C" fn amm_client_swap_words(
min_out: *const [u8; 16],
deadline: u64,
) -> AmmWords {
let (a, m) = (u128::from_le_bytes(*amount_in), u128::from_le_bytes(*min_out));
let (a, m) = (
u128::from_le_bytes(*amount_in),
u128::from_le_bytes(*min_out),
);
match swap::swap_exact_input_words(a, m, deadline) {
Ok(w) => {
let boxed = w.into_boxed_slice();

View File

@ -33,8 +33,7 @@ pub fn current_tick_pda(twap: ProgramId, pool: AccountId) -> AccountId {
#[cfg(test)]
mod tests {
use amm_core::compute_pool_pda;
use nssa_core::account::AccountId;
use nssa_core::program::ProgramId;
use nssa_core::{account::AccountId, program::ProgramId};
use super::*;

View File

@ -27,8 +27,7 @@ pub fn decode_pool(bytes: &[u8]) -> Result<PoolView, String> {
reserve_a: p.reserve_a,
reserve_b: p.reserve_b,
liquidity_supply: p.liquidity_pool_supply,
fees: u32::try_from(p.fees)
.map_err(|_| format!("pool fee {} exceeds u32::MAX", p.fees))?,
fees: u32::try_from(p.fees).map_err(|_| format!("pool fee {} exceeds u32::MAX", p.fees))?,
})
}