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

@ -1,14 +1,9 @@
#[cfg(feature = "std")]
use std::{fmt, fmt::Display, str::FromStr, string::String};
#[cfg(not(feature = "std"))]
use alloc::{
boxed::Box,
format,
string::{String, ToString},
vec::Vec,
};
#[cfg(not(feature = "std"))]
use core::{
fmt,
fmt::{Debug, Display},

View File

@ -9,7 +9,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
/// Database error

View File

@ -1,7 +1,5 @@
use reth_fs_util::FsPathError;
#[cfg(not(feature = "std"))]
use alloc::string::{String, ToString};
use reth_fs_util::FsPathError;
/// Storage lock error.
#[derive(Debug, Clone, PartialEq, Eq, derive_more::Display)]

View File

@ -6,7 +6,6 @@ use reth_primitives::{BlockHashOrNumber, GotExpected, StaticFileSegment, TxHashO
#[cfg(feature = "std")]
use std::path::PathBuf;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, string::String};
/// Provider result type.