chore(api): apply rustfmt across modules and tests

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Chengdong Zhang
2026-09-21 18:52:52 +08:00
co-authored by Cursor
parent 6c1357ec4d
commit a4ef6ca49e
46 changed files with 495 additions and 334 deletions
+8 -2
View File
@@ -57,7 +57,9 @@ pub async fn upsert(
use crate::error::ApiError;
let code = code.to_uppercase();
if code.len() != 3 || !code.chars().all(|c| c.is_ascii_uppercase()) {
return Err(ApiError::BadRequest("code must be a 3-letter ISO code".into()));
return Err(ApiError::BadRequest(
"code must be a 3-letter ISO code".into(),
));
}
if rate_to_base <= rust_decimal::Decimal::ZERO {
return Err(ApiError::BadRequest("rate_to_base must be > 0".into()));
@@ -82,7 +84,11 @@ pub async fn upsert(
.await?)
}
pub async fn set_rate(state: &AppState, code: &str, rate: rust_decimal::Decimal) -> ApiResult<Currency> {
pub async fn set_rate(
state: &AppState,
code: &str,
rate: rust_decimal::Decimal,
) -> ApiResult<Currency> {
use crate::error::ApiError;
if rate <= rust_decimal::Decimal::ZERO {
return Err(ApiError::BadRequest("rate_to_base must be > 0".into()));