Add missing_const_for_fn clippy lint (#8498)

This commit is contained in:
Thomas Coratger
2024-05-30 11:50:03 +02:00
committed by GitHub
parent 99068198db
commit 3d3f52b2a4
255 changed files with 834 additions and 804 deletions

View File

@ -303,7 +303,10 @@ pub enum MessageValidationKind {
impl MessageValidationKind {
/// Returns an `EngineObjectValidationError` based on the given
/// `VersionSpecificValidationError` and the current validation kind.
pub fn to_error(self, error: VersionSpecificValidationError) -> EngineObjectValidationError {
pub const fn to_error(
self,
error: VersionSpecificValidationError,
) -> EngineObjectValidationError {
match self {
Self::Payload => EngineObjectValidationError::Payload(error),
Self::PayloadAttributes => EngineObjectValidationError::PayloadAttributes(error),

View File

@ -24,7 +24,7 @@ where
{
/// Construct a [PayloadOrAttributes] from an [ExecutionPayload] and optional parent beacon
/// block root.
pub fn from_execution_payload(
pub const fn from_execution_payload(
payload: &'a ExecutionPayload,
parent_beacon_block_root: Option<B256>,
) -> Self {
@ -56,7 +56,7 @@ where
}
/// Return a [MessageValidationKind] for the payload or attributes.
pub fn message_validation_kind(&self) -> MessageValidationKind {
pub const fn message_validation_kind(&self) -> MessageValidationKind {
match self {
Self::ExecutionPayload { .. } => MessageValidationKind::Payload,
Self::PayloadAttributes(_) => MessageValidationKind::PayloadAttributes,