mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
Update `reqwest` to 0.12 so we only depend on a single version. This should slightly improve compile times and reduce binary bloat. Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
10 lines
336 B
Rust
10 lines
336 B
Rust
use eth2::StatusCode;
|
|
use warp::Rejection;
|
|
|
|
/// Convert from a "new" `http::StatusCode` to a `warp` compatible one.
|
|
pub fn convert(code: StatusCode) -> Result<warp::http::StatusCode, Rejection> {
|
|
code.as_u16().try_into().map_err(|e| {
|
|
crate::reject::custom_server_error(format!("bad status code {code:?} - {e:?}"))
|
|
})
|
|
}
|