Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Jul 4, 2022
1 parent 6108fed commit 5314b21
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions beacon_node/beacon_chain/src/validator_pubkey_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ impl<T: BeaconChainTypes> ValidatorPubkeyCache<T> {
pub fn len(&self) -> usize {
self.indices.len()
}

/// Returns `true` if there are no validators in the cache.
pub fn is_empty(&self) -> bool {
self.indices.is_empty()
}
}

/// Wrapper for a public key stored in the database.
Expand Down
4 changes: 2 additions & 2 deletions lcli/src/skip_slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const HTTP_TIMEOUT: Duration = Duration::from_secs(10);

pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
let spec = &T::default_spec();
let executor = env.core_context().executor.clone();
let executor = env.core_context().executor;

let output_path: Option<PathBuf> = parse_optional(matches, "output-path")?;
let state_path: Option<PathBuf> = parse_optional(matches, "state-path")?;
Expand All @@ -86,7 +86,7 @@ pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<
let client = BeaconNodeHttpClient::new(beacon_url, Timeouts::set_all(HTTP_TIMEOUT));
let state = executor
.handle()
.ok_or_else(|| "shut down in progress")?
.ok_or("shut down in progress")?
.block_on(async move {
client
.get_debug_beacon_states::<T>(state_id)
Expand Down
4 changes: 2 additions & 2 deletions lcli/src/transition_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct Config {

pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
let spec = &T::default_spec();
let executor = env.core_context().executor.clone();
let executor = env.core_context().executor;

/*
* Parse (most) CLI arguments.
Expand Down Expand Up @@ -135,7 +135,7 @@ pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<
let client = BeaconNodeHttpClient::new(beacon_url, Timeouts::set_all(HTTP_TIMEOUT));
executor
.handle()
.ok_or_else(|| "shut down in progress")?
.ok_or("shut down in progress")?
.block_on(async move {
let block = client
.get_beacon_blocks(block_id)
Expand Down

0 comments on commit 5314b21

Please sign in to comment.