cargo clippy

This commit is contained in:
f321x
2024-08-16 13:41:01 +02:00
parent 498d86e4c7
commit 1ad021ab03
4 changed files with 5 additions and 4 deletions

View File

@ -22,7 +22,7 @@ async fn receive_order(
Extension(coordinator): Extension<Arc<Coordinator>>, Extension(coordinator): Extension<Arc<Coordinator>>,
Json(offer): Json<OfferRequest>, Json(offer): Json<OfferRequest>,
) -> Result<Response, AppError> { ) -> Result<Response, AppError> {
if let Err(_) = offer.validate() { if offer.validate().is_err() {
Ok(StatusCode::BAD_REQUEST.into_response()) Ok(StatusCode::BAD_REQUEST.into_response())
} else { } else {
let bond_requirements = process_order(coordinator, &offer).await?; let bond_requirements = process_order(coordinator, &offer).await?;

View File

@ -78,7 +78,7 @@ impl KeyspendContext {
let agg_keyspend_pk: musig2::KeyAggContext = let agg_keyspend_pk: musig2::KeyAggContext =
wallet::aggregate_musig_pubkeys(maker_pk, taker_pk)?; wallet::aggregate_musig_pubkeys(maker_pk, taker_pk)?;
let agg_nonce: MusigAggNonce = let agg_nonce: MusigAggNonce =
coordinator_utils::agg_hex_musig_nonces(&maker_nonce, &taker_nonce)?; coordinator_utils::agg_hex_musig_nonces(maker_nonce, taker_nonce)?;
let keyspend_psbt = PartiallySignedTransaction::from_str(keyspend_psbt)?; let keyspend_psbt = PartiallySignedTransaction::from_str(keyspend_psbt)?;
let partial_maker_sig = PartialSignature::from_hex(maker_sig)?; let partial_maker_sig = PartialSignature::from_hex(maker_sig)?;
@ -120,6 +120,7 @@ impl KeyspendContext {
} }
impl PayoutData { impl PayoutData {
#[allow(clippy::too_many_arguments)]
pub fn new_from_strings( pub fn new_from_strings(
escrow_output_descriptor: &str, escrow_output_descriptor: &str,
payout_address_maker: &str, payout_address_maker: &str,

View File

@ -104,7 +104,7 @@ pub async fn handle_taker_bond(
debug!("\nTaker bond validation successful"); debug!("\nTaker bond validation successful");
let escrow_output_data = wallet let escrow_output_data = wallet
.create_escrow_psbt(database, &payload) .create_escrow_psbt(database, payload)
.await .await
.map_err(|e| BondError::CoordinatorError(e.to_string()))?; .map_err(|e| BondError::CoordinatorError(e.to_string()))?;
debug!( debug!(

View File

@ -677,7 +677,7 @@ impl CoordinatorDB {
}; };
if is_already_there { if is_already_there {
return Ok(false); Ok(false)
} else { } else {
let query = if is_maker { let query = if is_maker {
"UPDATE taken_offers SET signed_escrow_psbt_hex_maker = ? WHERE offer_id = ?" "UPDATE taken_offers SET signed_escrow_psbt_hex_maker = ? WHERE offer_id = ?"