Skip to content

Commit

Permalink
chore: remove redundant cfg annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksuss committed Mar 29, 2024
1 parent 8fccd35 commit 49e88fc
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 25 deletions.
1 change: 0 additions & 1 deletion core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub use crate::valids::Valids;

use crate::eval::{eval, Control};
use alloc::rc::Rc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use core::ops::Range;
use primitive_types::{H160, U256};
Expand Down
1 change: 0 additions & 1 deletion core/src/memory.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{ExitError, ExitFatal};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use core::cmp::min;
use core::ops::{BitAnd, Not};
Expand Down
1 change: 0 additions & 1 deletion core/src/stack.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::ExitError;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use primitive_types::{H256, U256};

Expand Down
1 change: 0 additions & 1 deletion core/src/valids.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::Opcode;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// Mapping of valid jump destination from code.
Expand Down
1 change: 0 additions & 1 deletion gasometer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ mod costs;
mod memory;
mod utils;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use core::cmp::max;
use evm_core::{ExitError, Opcode, Stack};
Expand Down
2 changes: 1 addition & 1 deletion gasometer/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use primitive_types::U256;

pub fn log2floor(value: U256) -> u64 {
assert!(value != U256::zero());
assert_ne!(value, U256::zero());
let mut l: u64 = 256;
for i in 0..4 {
let i = 3 - i;
Expand Down
1 change: 0 additions & 1 deletion runtime/src/eval/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod macros;
mod system;

use crate::{CallScheme, ExitReason, Handler, Opcode, Runtime};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use core::cmp::min;
use primitive_types::{H160, H256, U256};
Expand Down
1 change: 0 additions & 1 deletion runtime/src/eval/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::Control;
use crate::{
CallScheme, Capture, Context, CreateScheme, ExitError, ExitSucceed, Handler, Runtime, Transfer,
};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use primitive_types::{H256, U256};
use sha3::{Digest, Keccak256};
Expand Down
1 change: 0 additions & 1 deletion runtime/src/handler.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{Capture, Context, CreateScheme, ExitError, ExitReason, Machine, Opcode};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use primitive_types::{H160, H256, U256};

Expand Down
1 change: 0 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pub use crate::handler::{Handler, Transfer};
pub use crate::interrupt::{Resolve, ResolveCall, ResolveCreate};

use alloc::rc::Rc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use primitive_types::H160;

Expand Down
1 change: 0 additions & 1 deletion src/backend/memory.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use super::{Apply, ApplyBackend, Backend, Basic, Log};
use alloc::collections::BTreeMap;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use primitive_types::{H160, H256, U256};

Expand Down
8 changes: 4 additions & 4 deletions src/backend/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! # EVM backends
//!
//! Backends store state information of the VM, and exposes it to runtime.
use alloc::vec::Vec;
use primitive_types::{H160, H256, U256};

pub use self::memory::{MemoryAccount, MemoryBackend, MemoryVicinity};

mod memory;

pub use self::memory::{MemoryAccount, MemoryBackend, MemoryVicinity};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use primitive_types::{H160, H256, U256};
/// Basic account information.
#[derive(Clone, Eq, PartialEq, Debug, Default)]
#[cfg_attr(
Expand Down
4 changes: 1 addition & 3 deletions src/executor/stack/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use crate::{
Capture, Config, Context, CreateScheme, ExitError, ExitReason, Handler, Opcode, Runtime,
Transfer,
};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use alloc::{collections::BTreeSet, rc::Rc};
use alloc::{collections::BTreeSet, rc::Rc, vec::Vec};
use core::{cmp::min, convert::Infallible};
use evm_core::{ExitFatal, InterpreterHandler, Machine, Trap};
use evm_runtime::Resolve;
Expand Down
8 changes: 4 additions & 4 deletions src/executor/stack/memory.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::backend::{Apply, Backend, Basic, Log};
use crate::executor::stack::executor::{Accessed, StackState, StackSubstateMetadata};
use crate::{ExitError, Transfer};
use alloc::boxed::Box;
use alloc::collections::{BTreeMap, BTreeSet};
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, vec::Vec};
use alloc::vec::Vec;
use core::mem;
use primitive_types::{H160, H256, U256};

Expand All @@ -28,7 +28,7 @@ impl<'config> MemoryStackSubstate<'config> {
pub const fn new(metadata: StackSubstateMetadata<'config>) -> Self {
Self {
metadata,
parent: None,
parent: None::<Box<_>>,
logs: Vec::new(),
accounts: BTreeMap::new(),
storages: BTreeMap::new(),
Expand Down Expand Up @@ -289,7 +289,7 @@ impl<'config> MemoryStackSubstate<'config> {
})
.unwrap_or_else(|| MemoryStackAccount {
basic: backend.basic(address),
code: None,
code: None::<Vec<_>>,
reset: false,
});
self.accounts.insert(address, account);
Expand Down
4 changes: 2 additions & 2 deletions src/executor/stack/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! A stack-based executor with customizable state.
//! A memory-based state is provided, but can replaced by a custom
//! implementation, for exemple one interacting with a database.
//! A memory-based state is provided, but can be replaced by a custom
//! implementation, for example one interacting with a database.
mod executor;
mod memory;
Expand Down
1 change: 0 additions & 1 deletion src/executor/stack/precompile.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{Context, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed, Transfer};
use alloc::collections::BTreeMap;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use primitive_types::{H160, H256};

Expand Down

0 comments on commit 49e88fc

Please sign in to comment.