From 5c1569f9c2ffd9f87466b2435ad4f223039188c3 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 7 Jun 2023 17:31:15 -0700 Subject: [PATCH] clippy lint --- migration/src/m20230607_221917_total_deposits.rs | 9 --------- web3_proxy/src/frontend/users/subuser.rs | 1 - web3_proxy/src/stats/mod.rs | 4 ++-- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/migration/src/m20230607_221917_total_deposits.rs b/migration/src/m20230607_221917_total_deposits.rs index 3e544c90..382f78d3 100644 --- a/migration/src/m20230607_221917_total_deposits.rs +++ b/migration/src/m20230607_221917_total_deposits.rs @@ -56,18 +56,9 @@ impl MigrationTrait for Migration { } } -/// Learn more at https://docs.rs/sea-query#iden -#[derive(Iden)] -enum User { - Table, - Id, -} - #[derive(Iden)] enum Balance { Table, - Id, - UserId, TotalSpentIncludingFreeTier, TotalSpentOutsideFreeTier, TotalDeposits, diff --git a/web3_proxy/src/frontend/users/subuser.rs b/web3_proxy/src/frontend/users/subuser.rs index 2cea1621..317d121d 100644 --- a/web3_proxy/src/frontend/users/subuser.rs +++ b/web3_proxy/src/frontend/users/subuser.rs @@ -17,7 +17,6 @@ use hashbrown::HashMap; use http::StatusCode; use log::{trace, warn}; use migration::sea_orm; -use migration::sea_orm::prelude::Decimal; use migration::sea_orm::ActiveModelTrait; use migration::sea_orm::ColumnTrait; use migration::sea_orm::EntityTrait; diff --git a/web3_proxy/src/stats/mod.rs b/web3_proxy/src/stats/mod.rs index 57249b09..4d1c31c0 100644 --- a/web3_proxy/src/stats/mod.rs +++ b/web3_proxy/src/stats/mod.rs @@ -413,8 +413,8 @@ impl BufferedRpcQueryStats { return Ok((deltas, Some((referral_entity, referrer_code_entity)))); } - let user_balance = (sender_balance.total_deposits + deltas.sender_bonus_balance_deposited - - sender_balance.total_spent_outside_free_tier); + let user_balance = sender_balance.total_deposits + deltas.sender_bonus_balance_deposited + - sender_balance.total_spent_outside_free_tier; // Split up the component of into how much of the paid component was used, and how much of the free component was used (anything after "balance") if user_balance >= Decimal::from(0) { deltas.balance_used_outside_free_tier = self.sum_credits_used;