Skip to content

Commit aaae56e

Browse files
committed
lint: clippy
1 parent 3a3d177 commit aaae56e

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/tasks/block.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,7 @@ impl Simulator {
164164
///
165165
/// - `price`: A shared `Arc<AtomicU64>` used to store the updated basefee value.
166166
fn basefee_updater_fut(&self, price: Arc<AtomicU64>) -> impl Future<Output = ()> + use<> {
167-
<<<<<<< HEAD
168167
let slot_calculator = self.slot_calculator;
169-
=======
170-
let slot_calculator = self.slot_calculator.clone();
171-
>>>>>>> 07d3126 (lint:fmt)
172168
let ru_provider = self.ru_provider.clone();
173169

174170
async move {

src/tasks/env.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct EnvTask {
2020

2121
impl EnvTask {
2222
/// Create a new EnvTask with the given config and provider.
23-
pub fn new(config: BuilderConfig, provider: RuProvider) -> Self {
23+
pub const fn new(config: BuilderConfig, provider: RuProvider) -> Self {
2424
Self { config, provider }
2525
}
2626

@@ -97,7 +97,7 @@ impl EnvTask {
9797

9898
let env = self.construct_block_env(&previous);
9999
debug!(?env, "constructed block env");
100-
if let Err(_) = sender.send(Some(env)) {
100+
if sender.send(Some(env)).is_err() {
101101
// The receiver has been dropped, so we can stop the task.
102102
break;
103103
}

tests/block_builder_test.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ mod tests {
1515
use init4_bin_base::utils::calc::SlotCalculator;
1616
use signet_sim::{SimCache, SimItem};
1717
use signet_types::constants::SignetSystemConstants;
18-
use std::{
19-
sync::Arc,
20-
time::{Duration, Instant, SystemTime, UNIX_EPOCH},
21-
};
18+
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
2219
use tokio::{sync::mpsc::unbounded_channel, time::timeout};
2320

2421
/// Tests the `handle_build` method of the `Simulator`.
@@ -108,16 +105,16 @@ mod tests {
108105
// Create a rollup provider
109106
let ru_provider = RootProvider::<Ethereum>::new_http(anvil_instance.endpoint_url());
110107

111-
let sim = Arc::new(Simulator::new(&config, ru_provider.clone(), config.slot_calculator));
108+
let sim = Simulator::new(&config, ru_provider.clone(), config.slot_calculator);
112109

113110
// Create a shared sim cache
114111
let sim_cache = SimCache::new();
115112

116113
// Create a sim cache and start filling it with items
117-
sim.clone().spawn_cache_tasks(tx_receiver, bundle_receiver, sim_cache.clone());
114+
sim.spawn_cache_tasks(tx_receiver, bundle_receiver, sim_cache.clone());
118115

119116
// Finally, Kick off the block builder task.
120-
sim.clone().spawn_simulator_task(constants, sim_cache.clone(), block_sender);
117+
sim.spawn_simulator_task(constants, sim_cache.clone(), block_sender);
121118

122119
// Feed in transactions to the tx_sender and wait for the block to be simulated
123120
let tx_1 = new_signed_tx(&test_key_0, 0, U256::from(1_f64), 11_000).unwrap();

0 commit comments

Comments
 (0)