cfg: replace std feature gate alloc imports with extern crate alloc (#10861)

This commit is contained in:
Thomas Coratger
2024-09-13 18:01:12 +02:00
committed by GitHub
parent 6fc81f2b70
commit 47d188cb8e
54 changed files with 39 additions and 163 deletions

View File

@@ -9,11 +9,9 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, string::String};
use alloc::{boxed::Box, string::String};
use alloy_eips::BlockNumHash;
use alloy_primitives::B256;
use derive_more::Display;

View File

@@ -1,13 +1,11 @@
//! Errors when computing the state root.
use alloc::string::ToString;
use alloy_primitives::B256;
use derive_more::Display;
use nybbles::Nibbles;
use reth_storage_errors::{db::DatabaseError, provider::ProviderError};
#[cfg(not(feature = "std"))]
use alloc::string::ToString;
/// State root errors.
#[derive(Display, Debug, PartialEq, Eq, Clone)]
pub enum StateRootError {