From a46bd3c3af3c85b740ecdd4ff9ae5f1fb30c061b Mon Sep 17 00:00:00 2001 From: Kilerd Chan Date: Tue, 10 Sep 2024 18:12:51 +0800 Subject: [PATCH] style: fmt code --- zhang-ast/src/utils/inventory.rs | 2 +- zhang-core/src/store/mod.rs | 3 ++- zhang-server/src/request.rs | 5 +++-- zhang-server/src/routes/mod.rs | 9 ++++----- zhang-server/src/routes/transaction.rs | 3 +-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/zhang-ast/src/utils/inventory.rs b/zhang-ast/src/utils/inventory.rs index a92dc74a..4f93a335 100644 --- a/zhang-ast/src/utils/inventory.rs +++ b/zhang-ast/src/utils/inventory.rs @@ -57,7 +57,7 @@ impl LotMeta { } /// Inventory likes a warehouse to record how many commodities are used, and how much are they. -/// +/// /// And for investment tracing purpose, we need to record more details about how much we brought the commodity, and when. /// That's why we need to use `lots` to record the info. #[derive(Debug, Clone)] diff --git a/zhang-core/src/store/mod.rs b/zhang-core/src/store/mod.rs index 8d2c43db..ac221db9 100644 --- a/zhang-core/src/store/mod.rs +++ b/zhang-core/src/store/mod.rs @@ -1,6 +1,5 @@ use std::collections::{BTreeMap, HashMap, HashSet}; -use crate::domains::schemas::{AccountDomain, CommodityDomain, ErrorDomain, MetaDomain, PriceDomain}; use bigdecimal::BigDecimal; use chrono::{DateTime, NaiveDate}; use chrono_tz::Tz; @@ -9,6 +8,8 @@ use uuid::Uuid; use zhang_ast::amount::Amount; use zhang_ast::{Account, Flag, SpanInfo}; +use crate::domains::schemas::{AccountDomain, CommodityDomain, ErrorDomain, MetaDomain, PriceDomain}; + #[derive(Default, serde::Serialize)] pub struct Store { pub options: HashMap, diff --git a/zhang-server/src/request.rs b/zhang-server/src/request.rs index dda5c7d6..486857dd 100644 --- a/zhang-server/src/request.rs +++ b/zhang-server/src/request.rs @@ -1,8 +1,9 @@ +use std::cmp::max; +use std::collections::HashSet; + use bigdecimal::BigDecimal; use chrono::{DateTime, Datelike, Local, Utc}; use serde::Deserialize; -use std::cmp::max; -use std::collections::HashSet; use zhang_ast::Flag; #[derive(Deserialize)] diff --git a/zhang-server/src/routes/mod.rs b/zhang-server/src/routes/mod.rs index e4089e2c..f5fa3c30 100644 --- a/zhang-server/src/routes/mod.rs +++ b/zhang-server/src/routes/mod.rs @@ -12,11 +12,10 @@ pub mod plugin; #[cfg(feature = "frontend")] pub mod frontend; -use axum::{ - async_trait, - extract::FromRequestParts, - http::{request::Parts, StatusCode}, -}; +use axum::async_trait; +use axum::extract::FromRequestParts; +use axum::http::request::Parts; +use axum::http::StatusCode; use serde::de::DeserializeOwned; use serde_qs; diff --git a/zhang-server/src/routes/transaction.rs b/zhang-server/src/routes/transaction.rs index 9cd257b2..a367cbab 100644 --- a/zhang-server/src/routes/transaction.rs +++ b/zhang-server/src/routes/transaction.rs @@ -17,6 +17,7 @@ use zhang_core::ledger::Ledger; use zhang_core::store::TransactionDomain; use zhang_core::utils::string_::{escape_with_quote, StringExt}; +use super::Query; use crate::request::{CreateTransactionRequest, JournalRequest}; use crate::response::{ InfoForNewTransaction, JournalBalanceCheckItemResponse, JournalBalancePadItemResponse, JournalItemResponse, JournalTransactionItemResponse, @@ -24,8 +25,6 @@ use crate::response::{ }; use crate::{ApiResult, ReloadSender}; -use super::Query; - // todo rename api pub async fn get_info_for_new_transactions(ledger: State>>) -> ApiResult { let guard = ledger.read().await;