Skip to content

Commit 6071d59

Browse files
authored
chore: remove a bunch of unnecessary #[inline] (#11397)
1 parent 030b97d commit 6071d59

File tree

25 files changed

+0
-89
lines changed

25 files changed

+0
-89
lines changed

crates/anvil/src/eth/backend/mem/inspector.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ where
175175
}
176176
}
177177

178-
#[inline]
179178
fn selfdestruct(&mut self, contract: Address, target: Address, value: U256) {
180179
call_inspectors!([&mut self.tracer, &mut self.transfer], |inspector| {
181180
Inspector::<CTX, EthInterpreter>::selfdestruct(inspector, contract, target, value)

crates/cheatcodes/spec/src/cheatcode.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ impl Group {
141141
///
142142
/// Some groups are inherently safe or unsafe, while others are ambiguous and will return
143143
/// `None`.
144-
#[inline]
145144
pub const fn safety(self) -> Option<Safety> {
146145
match self {
147146
Self::Evm | Self::Testing => None,
@@ -158,7 +157,6 @@ impl Group {
158157
}
159158

160159
/// Returns this value as a string.
161-
#[inline]
162160
pub const fn as_str(self) -> &'static str {
163161
match self {
164162
Self::Evm => "evm",
@@ -192,7 +190,6 @@ pub enum Safety {
192190

193191
impl Safety {
194192
/// Returns this value as a string.
195-
#[inline]
196193
pub const fn as_str(self) -> &'static str {
197194
match self {
198195
Self::Safe => "safe",
@@ -201,7 +198,6 @@ impl Safety {
201198
}
202199

203200
/// Returns whether this value is safe.
204-
#[inline]
205201
pub const fn is_safe(self) -> bool {
206202
matches!(self, Self::Safe)
207203
}

crates/cheatcodes/spec/src/function.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ impl fmt::Display for Visibility {
6464

6565
impl Visibility {
6666
/// Returns the string representation of the visibility.
67-
#[inline]
6867
pub const fn as_str(self) -> &'static str {
6968
match self {
7069
Self::External => "external",
@@ -99,7 +98,6 @@ impl fmt::Display for Mutability {
9998

10099
impl Mutability {
101100
/// Returns the string representation of the mutability.
102-
#[inline]
103101
pub const fn as_str(self) -> &'static str {
104102
match self {
105103
Self::Pure => "pure",

crates/cheatcodes/src/error.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ impl Error {
142142
}
143143

144144
/// Returns the kind of this error.
145-
#[inline]
146145
pub fn kind(&self) -> ErrorKind<'_> {
147146
let data = self.data();
148147
if self.is_str {
@@ -154,38 +153,31 @@ impl Error {
154153
}
155154

156155
/// Returns the raw data of this error.
157-
#[inline]
158156
pub fn data(&self) -> &[u8] {
159157
unsafe { &*self.data }
160158
}
161159

162160
/// Returns `true` if this error is a human-readable string.
163-
#[inline]
164161
pub fn is_str(&self) -> bool {
165162
self.is_str
166163
}
167164

168-
#[inline]
169165
fn new_str(data: &'static str) -> Self {
170166
Self::_new(true, false, data.as_bytes())
171167
}
172168

173-
#[inline]
174169
fn new_string(data: String) -> Self {
175170
Self::_new(true, true, Box::into_raw(data.into_boxed_str().into_boxed_bytes()))
176171
}
177172

178-
#[inline]
179173
fn new_bytes(data: &'static [u8]) -> Self {
180174
Self::_new(false, false, data)
181175
}
182176

183-
#[inline]
184177
fn new_vec(data: Vec<u8>) -> Self {
185178
Self::_new(false, true, Box::into_raw(data.into_boxed_slice()))
186179
}
187180

188-
#[inline]
189181
fn _new(is_str: bool, drop: bool, data: *const [u8]) -> Self {
190182
debug_assert!(!data.is_null());
191183
Self { is_str, drop, data }
@@ -249,7 +241,6 @@ impl From<Vec<u8>> for Error {
249241
}
250242

251243
impl From<Bytes> for Error {
252-
#[inline]
253244
fn from(value: Bytes) -> Self {
254245
Self::new_vec(value.into())
255246
}

crates/cheatcodes/src/inspector.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ impl Clone for TestContext {
195195

196196
impl TestContext {
197197
/// Clears the context.
198-
#[inline]
199198
pub fn clear(&mut self) {
200199
self.opened_read_files.clear();
201200
}
@@ -1049,7 +1048,6 @@ impl Cheatcodes {
10491048
}
10501049

10511050
impl Inspector<EthEvmContext<&mut dyn DatabaseExt>> for Cheatcodes {
1052-
#[inline]
10531051
fn initialize_interp(&mut self, interpreter: &mut Interpreter, ecx: Ecx) {
10541052
// When the first interpreter is initialized we've circumvented the balance and gas checks,
10551053
// so we apply our actual block data with the correct fees and all.

crates/cheatcodes/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,10 @@ pub(crate) trait DynCheatcode: 'static + std::fmt::Debug {
9999
}
100100

101101
impl<T: Cheatcode> DynCheatcode for T {
102-
#[inline]
103102
fn cheatcode(&self) -> &'static spec::Cheatcode<'static> {
104103
Self::CHEATCODE
105104
}
106105

107-
#[inline]
108106
fn dyn_apply(&self, ccx: &mut CheatsCtxt, executor: &mut dyn CheatcodesExecutor) -> Result {
109107
self.apply_full(ccx, executor)
110108
}
@@ -157,12 +155,10 @@ impl std::ops::DerefMut for CheatsCtxt<'_, '_, '_, '_> {
157155
}
158156

159157
impl CheatsCtxt<'_, '_, '_, '_> {
160-
#[inline]
161158
pub(crate) fn ensure_not_precompile(&self, address: &Address) -> Result<()> {
162159
if self.is_precompile(address) { Err(precompile_error(address)) } else { Ok(()) }
163160
}
164161

165-
#[inline]
166162
pub(crate) fn is_precompile(&self, address: &Address) -> bool {
167163
self.ecx.journaled_state.warm_addresses.precompiles().contains(address)
168164
}

crates/cli/src/utils/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,10 @@ pub struct Git<'a> {
319319
}
320320

321321
impl<'a> Git<'a> {
322-
#[inline]
323322
pub fn new(root: &'a Path) -> Self {
324323
Self { root, quiet: shell::is_quiet(), shallow: false }
325324
}
326325

327-
#[inline]
328326
pub fn from_config(config: &'a Config) -> Self {
329327
Self::new(config.root.as_path())
330328
}
@@ -389,18 +387,15 @@ impl<'a> Git<'a> {
389387
.map(drop)
390388
}
391389

392-
#[inline]
393390
pub fn root(self, root: &Path) -> Git<'_> {
394391
Git { root, ..self }
395392
}
396393

397-
#[inline]
398394
pub fn quiet(self, quiet: bool) -> Self {
399395
Self { quiet, ..self }
400396
}
401397

402398
/// True to perform shallow clones
403-
#[inline]
404399
pub fn shallow(self, shallow: bool) -> Self {
405400
Self { shallow, ..self }
406401
}

crates/common/fmt/src/dynamic.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,12 @@ struct DynValueDisplay<'a> {
104104

105105
impl<'a> DynValueDisplay<'a> {
106106
/// Creates a new [`Display`](fmt::Display) wrapper for the given value.
107-
#[inline]
108107
fn new(value: &'a DynSolValue, raw: bool) -> Self {
109108
Self { value, formatter: DynValueFormatter { raw } }
110109
}
111110
}
112111

113112
impl fmt::Display for DynValueDisplay<'_> {
114-
#[inline]
115113
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
116114
self.formatter.value(self.value, f)
117115
}

crates/common/fmt/src/exp.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use yansi::Paint;
1515
/// 1234124124 -> 1.23e9
1616
/// 10000000 -> 1e7
1717
/// ```
18-
#[inline]
1918
pub fn to_exp_notation(value: U256, precision: usize, trim_end_zeros: bool, sign: Sign) -> String {
2019
let stringified = value.to_string();
2120
let exponent = stringified.len() - 1;

crates/common/src/calc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Commonly used calculations.
22
33
/// Returns the mean of the slice.
4-
#[inline]
54
pub fn mean(values: &[u64]) -> u64 {
65
if values.is_empty() {
76
return 0;
@@ -11,7 +10,6 @@ pub fn mean(values: &[u64]) -> u64 {
1110
}
1211

1312
/// Returns the median of a _sorted_ slice.
14-
#[inline]
1513
pub fn median_sorted(values: &[u64]) -> u64 {
1614
if values.is_empty() {
1715
return 0;

0 commit comments

Comments
 (0)