Skip to content

Commit

Permalink
chore: fix clippy on Rust nightly (#835)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Mar 3, 2025
1 parent b886ffd commit a0806e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions boltzr/src/api/lightning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ where
{
let node = match decode_node(&node) {
Ok(node) => node,
Err(response) => return Ok(response),
Err(response) => return Ok(*response),
};

Ok(
Expand All @@ -97,7 +97,7 @@ where
{
let node = match decode_node(&node) {
Ok(node) => node,
Err(response) => return Ok(response),
Err(response) => return Ok(*response),
};

Ok(
Expand All @@ -113,7 +113,7 @@ where
)
}

fn decode_node(node: &str) -> Result<Vec<u8>, axum::http::Response<axum::body::Body>> {
fn decode_node(node: &str) -> Result<Vec<u8>, Box<axum::http::Response<axum::body::Body>>> {
fn invalid_node_response<E: std::fmt::Display>(
err: E,
) -> axum::http::Response<axum::body::Body> {
Expand All @@ -129,12 +129,12 @@ fn decode_node(node: &str) -> Result<Vec<u8>, axum::http::Response<axum::body::B
Ok(match hex::decode(node) {
Ok(node) => {
if node.len() != 33 {
return Err(invalid_node_response("not a public key"));
return Err(Box::new(invalid_node_response("not a public key")));
}

node
}
Err(err) => return Err(invalid_node_response(err)),
Err(err) => return Err(Box::new(invalid_node_response(err))),
})
}

Expand Down

0 comments on commit a0806e2

Please sign in to comment.