Super small improvement: Remove unnecessary mut
(#3736)
## Issue Addressed
<!--Which issue # does this PR address?-->
Removed some unnecessary `mut`. 🙂
<!--
## Proposed Changes
Please list or describe the changes introduced by this PR.
-->
<!--
## Additional Info
Please provide any additional information. For example, future considerations
or information useful for reviewers.
-->
This commit is contained in:
parent
857ef25d28
commit
8a36acdb1a
@ -114,7 +114,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
|||||||
|
|
||||||
pub fn cli_run<T: EthSpec>(
|
pub fn cli_run<T: EthSpec>(
|
||||||
matches: &ArgMatches,
|
matches: &ArgMatches,
|
||||||
mut env: Environment<T>,
|
env: Environment<T>,
|
||||||
validator_dir: PathBuf,
|
validator_dir: PathBuf,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
let spec = env.core_context().eth2_config.spec;
|
let spec = env.core_context().eth2_config.spec;
|
||||||
|
@ -24,7 +24,7 @@ pub fn new_env() -> Environment<MinimalEthSpec> {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn basic() {
|
fn basic() {
|
||||||
let mut env = new_env();
|
let env = new_env();
|
||||||
let log = env.core_context().log().clone();
|
let log = env.core_context().log().clone();
|
||||||
let mut spec = env.eth2_config().spec.clone();
|
let mut spec = env.eth2_config().spec.clone();
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ pub fn prune_payloads<E: EthSpec>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Run the database manager, returning an error string if the operation did not succeed.
|
/// Run the database manager, returning an error string if the operation did not succeed.
|
||||||
pub fn run<T: EthSpec>(cli_args: &ArgMatches<'_>, mut env: Environment<T>) -> Result<(), String> {
|
pub fn run<T: EthSpec>(cli_args: &ArgMatches<'_>, env: Environment<T>) -> Result<(), String> {
|
||||||
let client_config = parse_client_config(cli_args, &env)?;
|
let client_config = parse_client_config(cli_args, &env)?;
|
||||||
let context = env.core_context();
|
let context = env.core_context();
|
||||||
let log = context.log().clone();
|
let log = context.log().clone();
|
||||||
|
@ -37,7 +37,7 @@ use types::{EthSpec, FullPayload, SignedBeaconBlock};
|
|||||||
|
|
||||||
const HTTP_TIMEOUT: Duration = Duration::from_secs(5);
|
const HTTP_TIMEOUT: Duration = Duration::from_secs(5);
|
||||||
|
|
||||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
pub fn run<T: EthSpec>(env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||||
let spec = &T::default_spec();
|
let spec = &T::default_spec();
|
||||||
let executor = env.core_context().executor;
|
let executor = env.core_context().executor;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ use types::EthSpec;
|
|||||||
pub const ETH1_GENESIS_UPDATE_INTERVAL: Duration = Duration::from_millis(7_000);
|
pub const ETH1_GENESIS_UPDATE_INTERVAL: Duration = Duration::from_millis(7_000);
|
||||||
|
|
||||||
pub fn run<T: EthSpec>(
|
pub fn run<T: EthSpec>(
|
||||||
mut env: Environment<T>,
|
env: Environment<T>,
|
||||||
testnet_dir: PathBuf,
|
testnet_dir: PathBuf,
|
||||||
matches: &ArgMatches<'_>,
|
matches: &ArgMatches<'_>,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
|
@ -59,7 +59,7 @@ use types::{BeaconState, CloneConfig, EthSpec, Hash256};
|
|||||||
|
|
||||||
const HTTP_TIMEOUT: Duration = Duration::from_secs(10);
|
const HTTP_TIMEOUT: Duration = Duration::from_secs(10);
|
||||||
|
|
||||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
pub fn run<T: EthSpec>(env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||||
let spec = &T::default_spec();
|
let spec = &T::default_spec();
|
||||||
let executor = env.core_context().executor;
|
let executor = env.core_context().executor;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ struct Config {
|
|||||||
exclude_post_block_thc: bool,
|
exclude_post_block_thc: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
pub fn run<T: EthSpec>(env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||||
let spec = &T::default_spec();
|
let spec = &T::default_spec();
|
||||||
let executor = env.core_context().executor;
|
let executor = env.core_context().executor;
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ impl<E: EthSpec> Environment<E> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a `Context` where no "service" has been added to the logger output.
|
/// Returns a `Context` where no "service" has been added to the logger output.
|
||||||
pub fn core_context(&mut self) -> RuntimeContext<E> {
|
pub fn core_context(&self) -> RuntimeContext<E> {
|
||||||
RuntimeContext {
|
RuntimeContext {
|
||||||
executor: TaskExecutor::new(
|
executor: TaskExecutor::new(
|
||||||
Arc::downgrade(self.runtime()),
|
Arc::downgrade(self.runtime()),
|
||||||
@ -395,7 +395,7 @@ impl<E: EthSpec> Environment<E> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a `Context` where the `service_name` is added to the logger output.
|
/// Returns a `Context` where the `service_name` is added to the logger output.
|
||||||
pub fn service_context(&mut self, service_name: String) -> RuntimeContext<E> {
|
pub fn service_context(&self, service_name: String) -> RuntimeContext<E> {
|
||||||
RuntimeContext {
|
RuntimeContext {
|
||||||
executor: TaskExecutor::new(
|
executor: TaskExecutor::new(
|
||||||
Arc::downgrade(self.runtime()),
|
Arc::downgrade(self.runtime()),
|
||||||
|
Loading…
Reference in New Issue
Block a user