Update to Rust 1.59 and 2021 edition (#3038)

## Proposed Changes

Lots of lint updates related to `flat_map`, `unwrap_or_else` and string patterns. I did a little more creative refactoring in the op pool, but otherwise followed Clippy's suggestions.

## Additional Info

We need this PR to unblock CI.
This commit is contained in:
Michael Sproul
2022-02-25 00:10:17 +00:00
parent c1df5d29cb
commit 5e1f8a8480
115 changed files with 173 additions and 188 deletions

View File

@@ -2,7 +2,7 @@
name = "ef_tests"
version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
edition = "2021"
[features]
# `ef_tests` feature must be enabled to actually run the tests

View File

@@ -259,10 +259,7 @@ impl<E: EthSpec, T: EpochTransition<E>> LoadCase for EpochProcessing<E, T> {
impl<E: EthSpec, T: EpochTransition<E>> Case for EpochProcessing<E, T> {
fn description(&self) -> String {
self.metadata
.description
.clone()
.unwrap_or_else(String::new)
self.metadata.description.clone().unwrap_or_default()
}
fn is_enabled_for_fork(fork_name: ForkName) -> bool {

View File

@@ -304,10 +304,7 @@ impl<E: EthSpec, O: Operation<E>> LoadCase for Operations<E, O> {
impl<E: EthSpec, O: Operation<E>> Case for Operations<E, O> {
fn description(&self) -> String {
self.metadata
.description
.clone()
.unwrap_or_else(String::new)
self.metadata.description.clone().unwrap_or_default()
}
fn is_enabled_for_fork(fork_name: ForkName) -> bool {

View File

@@ -103,10 +103,7 @@ impl<E: EthSpec> LoadCase for RewardsTest<E> {
impl<E: EthSpec> Case for RewardsTest<E> {
fn description(&self) -> String {
self.metadata
.description
.clone()
.unwrap_or_else(String::new)
self.metadata.description.clone().unwrap_or_default()
}
fn result(&self, _case_index: usize, fork_name: ForkName) -> Result<(), Error> {

View File

@@ -56,10 +56,7 @@ impl<E: EthSpec> LoadCase for SanityBlocks<E> {
impl<E: EthSpec> Case for SanityBlocks<E> {
fn description(&self) -> String {
self.metadata
.description
.clone()
.unwrap_or_else(String::new)
self.metadata.description.clone().unwrap_or_default()
}
fn result(&self, _case_index: usize, fork_name: ForkName) -> Result<(), Error> {

View File

@@ -50,10 +50,7 @@ impl<E: EthSpec> LoadCase for SanitySlots<E> {
impl<E: EthSpec> Case for SanitySlots<E> {
fn description(&self) -> String {
self.metadata
.description
.clone()
.unwrap_or_else(String::new)
self.metadata.description.clone().unwrap_or_default()
}
fn result(&self, _case_index: usize, fork_name: ForkName) -> Result<(), Error> {

View File

@@ -2,7 +2,7 @@
name = "eth1_test_rig"
version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
edition = "2021"
[dependencies]
tokio = { version = "1.14.0", features = ["time"] }

View File

@@ -2,7 +2,7 @@
name = "node_test_rig"
version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
edition = "2021"
[dependencies]
environment = { path = "../../lighthouse/environment" }

View File

@@ -2,7 +2,7 @@
name = "simulator"
version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -2,7 +2,7 @@
name = "state_transition_vectors"
version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -1,7 +1,7 @@
[package]
name = "test-test_logger"
version = "0.1.0"
edition = "2018"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -1,7 +1,7 @@
[package]
name = "web3signer_tests"
version = "0.1.0"
edition = "2018"
edition = "2021"
build = "build.rs"