clippy lint

This commit is contained in:
Bryan Stitt 2023-06-07 17:31:15 -07:00
parent 40bee30730
commit 5c1569f9c2
3 changed files with 2 additions and 12 deletions

View File

@ -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,

View File

@ -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;

View File

@ -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;