Skip to content

Commit c9243cb

Browse files
committed
fmt, clippy
1 parent ac7df5c commit c9243cb

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ use axum::{
1616
};
1717
use lazy_static::lazy_static;
1818
use namada_sdk::{
19-
address::Address, args::TxBuilder, chain::ChainId, io::NullIo, key::RefTo,
20-
masp::fs::FsShieldedUtils, wallet::fs::FsWalletUtils, NamadaImpl,
19+
address::Address, io::NullIo, key::RefTo, masp::fs::FsShieldedUtils, wallet::fs::FsWalletUtils,
20+
NamadaImpl,
2121
};
2222
use rand::{distributions::Alphanumeric, thread_rng, Rng};
2323
use serde_json::json;

src/handler/faucet.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ pub async fn faucet_settings(
2626
State(state): State<FaucetState>,
2727
) -> Result<Json<FaucetSettingResponse>, ApiError> {
2828
let client = &state.sdk.clone_client();
29-
29+
3030
let nam_token_address = rpc::query_native_token(client).await.unwrap();
31-
31+
3232
let faucet_address = state.faucet_address.clone();
3333
let faucet_balance = rpc::get_token_balance(client, &nam_token_address, &faucet_address, None)
3434
.await
@@ -112,7 +112,7 @@ pub async fn request_transfer(
112112
let captcha_token = payload
113113
.captcha_token
114114
.as_ref()
115-
.ok_or_else(|| FaucetError::InvalidCaptcha)?;
115+
.ok_or(FaucetError::InvalidCaptcha)?;
116116

117117
// Ensure captcha token is not empty
118118
if captcha_token.trim().is_empty() {
@@ -205,21 +205,15 @@ pub async fn request_transfer(
205205

206206
transfer_tx_builder.tx.memo = Some("Transfer from faucet".to_string().as_bytes().to_vec());
207207

208-
let tx_result = transfer_tx_builder
209-
.build(&*state.sdk)
210-
.await;
208+
let tx_result = transfer_tx_builder.build(&*state.sdk).await;
211209

212210
let (mut transfer_tx, signing_data) = match tx_result {
213211
Ok(res) => res,
214212
Err(e) => {
215-
return Err(FaucetError::SdkError(format!(
216-
"unable to build transfer tx: {}",
217-
e
218-
))
219-
.into())
213+
return Err(FaucetError::SdkError(format!("unable to build transfer tx: {}", e)).into())
220214
}
221215
};
222-
216+
223217
state
224218
.sdk
225219
.sign(

0 commit comments

Comments
 (0)