mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Fix clippy warnings (#1385)
## Issue Addressed NA ## Proposed Changes Fixes most clippy warnings and ignores the rest of them, see issue #1388.
This commit is contained in:
@@ -17,10 +17,7 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
|
||||
.expect("missing validators_per_node default");
|
||||
let speed_up_factor =
|
||||
value_t!(matches, "speed_up_factor", u64).expect("missing speed_up_factor default");
|
||||
let mut end_after_checks = true;
|
||||
if matches.is_present("end_after_checks") {
|
||||
end_after_checks = false;
|
||||
}
|
||||
let end_after_checks = !matches.is_present("end_after_checks");
|
||||
|
||||
println!("Beacon Chain Simulator:");
|
||||
println!(" nodes:{}", node_count);
|
||||
@@ -83,7 +80,7 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
|
||||
// Start a timer that produces eth1 blocks on an interval.
|
||||
tokio::spawn(async move {
|
||||
let mut interval = tokio::time::interval(eth1_block_time);
|
||||
while let Some(_) = interval.next().await {
|
||||
while interval.next().await.is_some() {
|
||||
let _ = ganache.evm_mine().await;
|
||||
}
|
||||
});
|
||||
@@ -198,5 +195,6 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
|
||||
Ok::<(), String>(())
|
||||
};
|
||||
|
||||
Ok(env.runtime().block_on(main_future).unwrap())
|
||||
env.runtime().block_on(main_future).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -17,10 +17,7 @@ pub fn run_no_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
|
||||
.expect("missing validators_per_node default");
|
||||
let speed_up_factor =
|
||||
value_t!(matches, "speed_up_factor", u64).expect("missing speed_up_factor default");
|
||||
let mut end_after_checks = true;
|
||||
if matches.is_present("end_after_checks") {
|
||||
end_after_checks = false;
|
||||
}
|
||||
let end_after_checks = !matches.is_present("end_after_checks");
|
||||
|
||||
println!("Beacon Chain Simulator:");
|
||||
println!(" nodes:{}", node_count);
|
||||
@@ -165,5 +162,6 @@ pub fn run_no_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
|
||||
Ok::<(), String>(())
|
||||
};
|
||||
|
||||
Ok(env.runtime().block_on(main_future).unwrap())
|
||||
env.runtime().block_on(main_future).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ pub async fn verify_one_node_sync<E: EthSpec>(
|
||||
// limited to at most `sync_timeout` epochs
|
||||
let mut interval = tokio::time::interval(epoch_duration);
|
||||
let mut count = 0;
|
||||
while let Some(_) = interval.next().await {
|
||||
while interval.next().await.is_some() {
|
||||
if count >= sync_timeout || !check_still_syncing(&network_c).await? {
|
||||
break;
|
||||
}
|
||||
@@ -246,7 +246,7 @@ pub async fn verify_two_nodes_sync<E: EthSpec>(
|
||||
// limited to at most `sync_timeout` epochs
|
||||
let mut interval = tokio::time::interval(epoch_duration);
|
||||
let mut count = 0;
|
||||
while let Some(_) = interval.next().await {
|
||||
while interval.next().await.is_some() {
|
||||
if count >= sync_timeout || !check_still_syncing(&network_c).await? {
|
||||
break;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ pub async fn verify_in_between_sync<E: EthSpec>(
|
||||
// limited to at most `sync_timeout` epochs
|
||||
let mut interval = tokio::time::interval(epoch_duration);
|
||||
let mut count = 0;
|
||||
while let Some(_) = interval.next().await {
|
||||
while interval.next().await.is_some() {
|
||||
if count >= sync_timeout || !check_still_syncing(&network_c).await? {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user