mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Update Rust Edition to 2024 (#7766)
* #7749 Thanks @dknopik and @michaelsproul for your help!
This commit is contained in:
@@ -24,13 +24,13 @@ use libp2p_identity::PeerId;
|
||||
use pretty_reqwest_error::PrettyReqwestError;
|
||||
pub use reqwest;
|
||||
use reqwest::{
|
||||
header::{HeaderMap, HeaderValue},
|
||||
Body, IntoUrl, RequestBuilder, Response,
|
||||
header::{HeaderMap, HeaderValue},
|
||||
};
|
||||
pub use reqwest::{StatusCode, Url};
|
||||
use reqwest_eventsource::{Event, EventSource};
|
||||
pub use sensitive_url::{SensitiveError, SensitiveUrl};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use serde::{Serialize, de::DeserializeOwned};
|
||||
use ssz::Encode;
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
@@ -2755,7 +2755,7 @@ impl BeaconNodeHttpClient {
|
||||
pub async fn get_events<E: EthSpec>(
|
||||
&self,
|
||||
topic: &[EventTopic],
|
||||
) -> Result<impl Stream<Item = Result<EventKind<E>, Error>>, Error> {
|
||||
) -> Result<impl Stream<Item = Result<EventKind<E>, Error>> + use<E>, Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
|
||||
@@ -6,9 +6,9 @@ mod block_rewards;
|
||||
pub mod sync_state;
|
||||
|
||||
use crate::{
|
||||
BeaconNodeHttpClient, DepositData, Error, Hash256, Slot,
|
||||
lighthouse::sync_state::SyncState,
|
||||
types::{AdminPeer, Epoch, GenericResponse, ValidatorId},
|
||||
BeaconNodeHttpClient, DepositData, Error, Hash256, Slot,
|
||||
};
|
||||
use proto_array::core::ProtoArray;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use super::types::*;
|
||||
use crate::Error;
|
||||
use reqwest::{
|
||||
header::{HeaderMap, HeaderValue},
|
||||
IntoUrl,
|
||||
header::{HeaderMap, HeaderValue},
|
||||
};
|
||||
use sensitive_url::SensitiveUrl;
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use serde::{Serialize, de::DeserializeOwned};
|
||||
use std::fmt::{self, Display};
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::{types::Accept, Error, CONSENSUS_VERSION_HEADER};
|
||||
use reqwest::{header::ACCEPT, RequestBuilder, Response, StatusCode};
|
||||
use crate::{CONSENSUS_VERSION_HEADER, Error, types::Accept};
|
||||
use reqwest::{RequestBuilder, Response, StatusCode, header::ACCEPT};
|
||||
use std::str::FromStr;
|
||||
use types::ForkName;
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
//! required for the HTTP API.
|
||||
|
||||
use crate::{
|
||||
Error as ServerError, CONSENSUS_BLOCK_VALUE_HEADER, CONSENSUS_VERSION_HEADER,
|
||||
EXECUTION_PAYLOAD_BLINDED_HEADER, EXECUTION_PAYLOAD_VALUE_HEADER,
|
||||
CONSENSUS_BLOCK_VALUE_HEADER, CONSENSUS_VERSION_HEADER, EXECUTION_PAYLOAD_BLINDED_HEADER,
|
||||
EXECUTION_PAYLOAD_VALUE_HEADER, Error as ServerError,
|
||||
};
|
||||
use enr::{CombinedKey, Enr};
|
||||
use mediatype::{names, MediaType, MediaTypeList};
|
||||
use mediatype::{MediaType, MediaTypeList, names};
|
||||
use multiaddr::Multiaddr;
|
||||
use reqwest::header::HeaderMap;
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
@@ -1115,7 +1115,7 @@ impl<'de> ContextDeserialize<'de, ForkName> for SsePayloadAttributes {
|
||||
return Err(serde::de::Error::custom(format!(
|
||||
"SsePayloadAttributes failed to deserialize: unsupported fork '{}'",
|
||||
context
|
||||
)))
|
||||
)));
|
||||
}
|
||||
ForkName::Bellatrix => {
|
||||
Self::V1(Deserialize::deserialize(deserializer).map_err(convert_err)?)
|
||||
@@ -1565,7 +1565,7 @@ pub struct BroadcastValidationQuery {
|
||||
|
||||
pub mod serde_status_code {
|
||||
use crate::StatusCode;
|
||||
use serde::{de::Error, Deserialize, Serialize};
|
||||
use serde::{Deserialize, Serialize, de::Error};
|
||||
|
||||
pub fn serialize<S>(status_code: &StatusCode, ser: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user