From 39ec2b3e2e90880603a82095970e47added02ddd Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Tue, 1 Sep 2026 13:39:05 +0000 Subject: [PATCH] chore: reformat three comments for current nightly rustfmt --- modules/amm/ffi/src/api/liquidity.rs | 3 ++- programs/amm/core/src/lib.rs | 3 ++- programs/amm/src/tests.rs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/amm/ffi/src/api/liquidity.rs b/modules/amm/ffi/src/api/liquidity.rs index 840d9768..c1cff9fb 100644 --- a/modules/amm/ffi/src/api/liquidity.rs +++ b/modules/amm/ffi/src/api/liquidity.rs @@ -1164,7 +1164,8 @@ mod tests { .unwrap(); assert_eq!(ab["amountA"], "100000"); // floor(1_000_000 * 100_000 / 1_000_000) assert_eq!(ab["amountB"], "200000"); // floor(2_000_000 * 100_000 / 1_000_000) - // minimum = floor(withdraw * (10000 - 50) / 10000) — the slippage floor per side. + // minimum = floor(withdraw * (10000 - 50) / 10000) — + // the slippage floor per side. assert_eq!(ab["minimumAmountA"], "99500"); assert_eq!(ab["minimumAmountB"], "199000"); assert_eq!( diff --git a/programs/amm/core/src/lib.rs b/programs/amm/core/src/lib.rs index f39d611d..f570cbd8 100644 --- a/programs/amm/core/src/lib.rs +++ b/programs/amm/core/src/lib.rs @@ -874,7 +874,8 @@ mod tests { // 1e20 * 2e20 = 2e40 overflows u128 (max ~3.4e38); the U256 intermediate keeps it exact. let a = 100_000_000_000_000_000_000u128; // 1e20 let b = 200_000_000_000_000_000_000u128; // 2e20 - // floor(sqrt(2e40)) computed independently in U256. + // floor(sqrt(2e40)) computed independently in + // U256. let expected = { use alloy_primitives::U256; let product = U256::from(a).checked_mul(U256::from(b)).unwrap(); diff --git a/programs/amm/src/tests.rs b/programs/amm/src/tests.rs index a84c4bd6..2a8fee2e 100644 --- a/programs/amm/src/tests.rs +++ b/programs/amm/src/tests.rs @@ -3687,7 +3687,8 @@ fn add_liquidity_overflow_protection() { fn remove_liquidity_overflow_protection() { let large_reserve: u128 = u128::MAX / 2 + 1; // 2^127 let reserve_b: u128 = 1_000; - let lp_supply: u128 = 1_002; // must exceed MINIMUM_LIQUIDITY so remove_amount=2 passes the lock check + let lp_supply: u128 = 1_002; // must exceed MINIMUM_LIQUIDITY so remove_amount=2 passes the lock + // check let pool = AccountWithMetadata { account: Account {