mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-02 04:03:35 +00:00
Remove `reqwest` from being re-exported within `eth2` Co-Authored-By: Mac L <mjladson@pm.me>
10 lines
339 B
Rust
10 lines
339 B
Rust
use reqwest::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:?}"))
|
|
})
|
|
}
|