From 39170be7bafeb2269296bebc0f1263aecbcdf205 Mon Sep 17 00:00:00 2001 From: Macpie Date: Wed, 4 Sep 2024 15:11:27 -0700 Subject: [PATCH] Inline fun --- mobile_verifier/src/promotion_reward.rs | 38 +++++++++---------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/mobile_verifier/src/promotion_reward.rs b/mobile_verifier/src/promotion_reward.rs index d86085972..d937e06f4 100644 --- a/mobile_verifier/src/promotion_reward.rs +++ b/mobile_verifier/src/promotion_reward.rs @@ -198,25 +198,6 @@ async fn validate_promotion_reward( } impl ValidatedPromotionReward { - async fn validate( - promotion_reward: PromotionReward, - authorization_verifier: &impl AuthorizationVerifier, - gateway_info_resolver: &impl GatewayResolver, - entity_verifier: &impl EntityVerifier, - ) -> anyhow::Result { - let validity = validate_promotion_reward( - &promotion_reward, - authorization_verifier, - gateway_info_resolver, - entity_verifier, - ) - .await?; - Ok(Self { - validity, - promotion_reward, - }) - } - fn validate_promotion_rewards<'a>( promotion_rewards: impl Stream + 'a, authorization_verifier: &'a impl AuthorizationVerifier, @@ -224,12 +205,19 @@ impl ValidatedPromotionReward { entity_verifier: &'a impl EntityVerifier, ) -> impl Stream> + 'a { promotion_rewards.then(move |promotion_reward| async move { - Self::validate( - promotion_reward, - authorization_verifier, - gateway_info_resolver, - entity_verifier, - ) + async move { + let validity = validate_promotion_reward( + &promotion_reward, + authorization_verifier, + gateway_info_resolver, + entity_verifier, + ) + .await?; + Ok(Self { + validity, + promotion_reward: promotion_reward, + }) + } .await }) }