mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Fix Rust beta compiler errors (1.77) (#5180)
* Lint fixes * More fixes for beta compiler. * Format fixes * Move `#[allow(dead_code)]` to field level. * Remove old comment. * Update beacon_node/execution_layer/src/test_utils/mod.rs Co-authored-by: João Oliveira <hello@jxs.pt> * remove duplicate line
This commit is contained in:
@@ -54,7 +54,8 @@ impl Operation {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Custom(String);
|
||||
// We don't use the string value directly, but it's used in the Debug impl which is required by `warp::reject::Reject`.
|
||||
struct Custom(#[allow(dead_code)] String);
|
||||
|
||||
impl warp::reject::Reject for Custom {}
|
||||
|
||||
|
||||
@@ -599,8 +599,8 @@ async fn handle_rejection(err: Rejection) -> Result<impl warp::Reply, Infallible
|
||||
let code;
|
||||
let message;
|
||||
|
||||
if let Some(e) = err.find::<AuthError>() {
|
||||
message = format!("Authorization error: {:?}", e);
|
||||
if let Some(AuthError(e)) = err.find::<AuthError>() {
|
||||
message = format!("Authorization error: {}", e);
|
||||
code = StatusCode::UNAUTHORIZED;
|
||||
} else {
|
||||
message = "BAD_REQUEST".to_string();
|
||||
|
||||
Reference in New Issue
Block a user