Skip to content

Commit 64991f8

Browse files
committed
clippy
1 parent ca3ee4d commit 64991f8

File tree

9 files changed

+19
-22
lines changed

9 files changed

+19
-22
lines changed

crates/rbuilder/benches/benchmarks/txpool_fetcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async fn txpool_receive_util(count: u32) {
3232

3333
let provider = ProviderBuilder::new()
3434
.wallet(wallet)
35-
.on_http(anvil.endpoint().parse().unwrap());
35+
.connect_http(anvil.endpoint().parse().unwrap());
3636

3737
let alice = anvil.addresses()[0];
3838
let eip1559_est = provider.estimate_eip1559_fees().await.unwrap();

crates/rbuilder/src/backtest/restore_landed_orders/find_landed_orders.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ mod tests {
460460
];
461461
for (idx, (chunk_idx, chunk_txs_block_idx, expected)) in cases.into_iter().enumerate() {
462462
let got = find_allowed_range(block_len, chunk_idx, &chunk_txs_block_idx);
463-
assert_eq!(expected, got, "Test index: {}", idx);
463+
assert_eq!(expected, got, "Test index: {idx}");
464464
}
465465
}
466466

@@ -474,7 +474,7 @@ mod tests {
474474
for expected_result in expected {
475475
let got_result = got
476476
.get(&expected_result.order)
477-
.unwrap_or_else(|| panic!("Order not found: {:?}", expected_result));
477+
.unwrap_or_else(|| panic!("Order not found: {expected_result:?}"));
478478
assert_eq!(expected_result, *got_result);
479479
}
480480
}

crates/rbuilder/src/beacon_api_client/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ mod tests {
8585
// validate that the stream is not empty
8686
// TODO: add timeout
8787
let event = stream.next().await.unwrap().unwrap();
88-
print!("{:?}", event);
88+
print!("{event:?}");
8989
}
9090
}

crates/rbuilder/src/building/testing/bundle_tests/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,10 +856,7 @@ fn test_subbundle_skip() -> eyre::Result<()> {
856856
if let OrderErr::Bundle(BundleErr::TransactionReverted(hash)) = err {
857857
assert_eq!(hash, revert_hash);
858858
} else {
859-
panic!(
860-
"got {} while expecting OrderErr::Bundle(BundleErr::TransactionReverted)",
861-
err
862-
);
859+
panic!("got {err} while expecting OrderErr::Bundle(BundleErr::TransactionReverted)");
863860
}
864861
});
865862

crates/rbuilder/src/building/testing/bundle_tests/setup.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,14 @@ impl TestSetup {
274274
pub fn commit_order_err_check_text(&mut self, expected_error: &str) {
275275
let res = self.try_commit_order().expect("Failed to commit order");
276276
match res {
277-
Ok(_) => panic!("expected error, result: {:#?}", res),
277+
Ok(_) => panic!("expected error, result: {res:#?}"),
278278
Err(err) => {
279279
if !err
280280
.to_string()
281281
.to_lowercase()
282282
.contains(&expected_error.to_lowercase())
283283
{
284-
panic!("unexpected error: {}, expected: {}", err, expected_error);
284+
panic!("unexpected error: {err}, expected: {expected_error}");
285285
}
286286
}
287287
}
@@ -291,12 +291,12 @@ impl TestSetup {
291291
pub fn commit_order_err_check<F: FnOnce(OrderErr)>(&mut self, err_check: F) {
292292
let res = self.try_commit_order().expect("Failed to commit order");
293293
match res {
294-
Ok(_) => panic!("expected error,got ok result: {:#?}", res),
294+
Ok(_) => panic!("expected error,got ok result: {res:#?}"),
295295
Err(err) => {
296296
if let ExecutionError::OrderError(order_error) = err {
297297
err_check(order_error);
298298
} else {
299-
panic!("unexpected non OrderErr error: {}", err);
299+
panic!("unexpected non OrderErr error: {err}");
300300
}
301301
}
302302
}

crates/rbuilder/src/live_builder/base_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ mod test {
725725
// Setup and initialize a temp reth db (with static files)
726726
let tempdir = TempDir::with_prefix_in("rbuilder-", "/tmp").unwrap();
727727

728-
let data_dir = MaybePlatformPath::<DataDirPath>::from(tempdir.into_path());
728+
let data_dir = MaybePlatformPath::<DataDirPath>::from(tempdir.keep());
729729
let data_dir = data_dir.unwrap_or_chain_default(Chain::mainnet(), DatadirArgs::default());
730730

731731
let db = Arc::new(init_db(data_dir.data_dir(), Default::default()).unwrap());

crates/rbuilder/src/live_builder/block_list_provider.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,20 +274,20 @@ pub mod test {
274274

275275
fn run(&self, port: u64) {
276276
// Create the address string once
277-
let addr = format!("127.0.0.1:{}", port);
277+
let addr = format!("127.0.0.1:{port}");
278278

279279
// Create a TCP listener bound to the specified port
280280
let listener = TcpListener::bind(&addr).unwrap();
281-
println!("Server running at http://{}", addr);
281+
println!("Server running at http://{addr}");
282282

283283
// Listen for incoming connections
284284
for stream in listener.incoming() {
285285
match stream {
286286
Ok(stream) => {
287287
self.handle_connection(stream);
288288
}
289-
Err(e) => {
290-
eprintln!("Connection failed: {}", e);
289+
Err(err) => {
290+
eprintln!("Connection failed: {err}");
291291
}
292292
}
293293
}
@@ -337,7 +337,7 @@ pub mod test {
337337
// ugly wait for BlocklistHttpServer
338338
tokio::time::sleep(Duration::from_millis(200)).await;
339339
let provider = HttpBlockListProvider::new(
340-
Url::parse(&format!("http://127.0.0.1:{}", PORT)).unwrap(),
340+
Url::parse(&format!("http://127.0.0.1:{PORT}")).unwrap(),
341341
Duration::from_secs(AGE_SECS),
342342
true,
343343
cancellation.clone(),

crates/rbuilder/src/live_builder/block_output/unfinished_block_processing.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ impl FinalizeWorker {
104104
payout_tx_val,
105105
seen_competition_bid,
106106
} = finalize_task;
107-
trace!(payout_tx_val = ?payout_tx_val.map(|v| format_ether(v)),
108-
seen_competition_bid = ?seen_competition_bid.map(|v| format_ether(v)),
107+
trace!(payout_tx_val = ?payout_tx_val.map(format_ether),
108+
seen_competition_bid = ?seen_competition_bid.map(format_ether),
109109
"Started block finalization");
110110
match block.finalize_block(&mut local_ctx, payout_tx_val, seen_competition_bid) {
111111
Ok(result) => {
@@ -308,7 +308,7 @@ impl UnfinishedBlocksSlotWorker {
308308
self.pending_blocks
309309
.push_back((new_block_id, last_best_block.block.box_clone()));
310310
let block_descriptor =
311-
BuiltBlockDescriptorForSlotBidder::new(new_block_id, &last_best_block);
311+
BuiltBlockDescriptorForSlotBidder::new(new_block_id, last_best_block);
312312
self.slot_bidder.notify_new_built_block(block_descriptor);
313313
}
314314
BlockSealSlotWorkerCommands::SealBid(slot_bidder_seal_bid_command) => {

crates/rbuilder/src/mev_boost/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ mod tests {
10381038
entry: ValidatorRegistration {
10391039
message: ValidatorRegistrationMessage {
10401040
timestamp: 0,
1041-
gas_limit: 30_000_00,
1041+
gas_limit: 30_000_000,
10421042
fee_recipient: Address::random(),
10431043
pubkey: H384::random(),
10441044
},

0 commit comments

Comments
 (0)