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:
Akihito Nakano 2022-11-21 03:15:54 +00:00
parent 857ef25d28
commit 8a36acdb1a
8 changed files with 9 additions and 9 deletions

View File

@ -114,7 +114,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
pub fn cli_run<T: EthSpec>(
matches: &ArgMatches,
mut env: Environment<T>,
env: Environment<T>,
validator_dir: PathBuf,
) -> Result<(), String> {
let spec = env.core_context().eth2_config.spec;

View File

@ -24,7 +24,7 @@ pub fn new_env() -> Environment<MinimalEthSpec> {
#[test]
fn basic() {
let mut env = new_env();
let env = new_env();
let log = env.core_context().log().clone();
let mut spec = env.eth2_config().spec.clone();

View File

@ -288,7 +288,7 @@ pub fn prune_payloads<E: EthSpec>(
}
/// 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 context = env.core_context();
let log = context.log().clone();

View File

@ -37,7 +37,7 @@ use types::{EthSpec, FullPayload, SignedBeaconBlock};
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 executor = env.core_context().executor;

View File

@ -13,7 +13,7 @@ use types::EthSpec;
pub const ETH1_GENESIS_UPDATE_INTERVAL: Duration = Duration::from_millis(7_000);
pub fn run<T: EthSpec>(
mut env: Environment<T>,
env: Environment<T>,
testnet_dir: PathBuf,
matches: &ArgMatches<'_>,
) -> Result<(), String> {

View File

@ -59,7 +59,7 @@ use types::{BeaconState, CloneConfig, EthSpec, Hash256};
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 executor = env.core_context().executor;

View File

@ -94,7 +94,7 @@ struct Config {
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 executor = env.core_context().executor;

View File

@ -380,7 +380,7 @@ impl<E: EthSpec> Environment<E> {
}
/// 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 {
executor: TaskExecutor::new(
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.
pub fn service_context(&mut self, service_name: String) -> RuntimeContext<E> {
pub fn service_context(&self, service_name: String) -> RuntimeContext<E> {
RuntimeContext {
executor: TaskExecutor::new(
Arc::downgrade(self.runtime()),