Fix Rust beta compiler errors 1.78.0-beta.1 (#5439)

* remove redundant imports

* fix test

* contains key

* fmt

* Merge branch 'unstable' into fix-beta-compiler
This commit is contained in:
Eitan Seri-Levi
2024-03-20 07:17:02 +02:00
committed by GitHub
parent 4449627c7c
commit 01ec42e75a
148 changed files with 104 additions and 301 deletions

View File

@@ -2,7 +2,7 @@
use crate::test_utils::*;
use crate::*;
use types::{AttestationData, Checkpoint, Epoch, Hash256, Slot};
use types::{AttestationData, Checkpoint, Epoch, Slot};
pub fn build_checkpoint(epoch_num: u64) -> Checkpoint {
Checkpoint {

View File

@@ -2,7 +2,7 @@
use super::*;
use crate::test_utils::*;
use types::{BeaconBlockHeader, Hash256, Slot};
use types::{BeaconBlockHeader, Slot};
pub fn block(slot: u64) -> BeaconBlockHeader {
BeaconBlockHeader {

View File

@@ -17,8 +17,8 @@ pub use crate::slashing_database::{
SUPPORTED_INTERCHANGE_FORMAT_VERSION,
};
use rusqlite::Error as SQLError;
use std::fmt::Display;
use std::io::{Error as IOError, ErrorKind};
use std::string::ToString;
use types::{Hash256, PublicKeyBytes};
/// The filename within the `validators` directory that contains the slashing protection DB.
@@ -122,9 +122,9 @@ impl From<r2d2::Error> for NotSafe {
}
}
impl ToString for NotSafe {
fn to_string(&self) -> String {
format!("{:?}", self)
impl Display for NotSafe {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self)
}
}

View File

@@ -1,9 +1,6 @@
use crate::*;
use tempfile::{tempdir, TempDir};
use types::{
test_utils::generate_deterministic_keypair, AttestationData, BeaconBlockHeader, Hash256,
PublicKeyBytes,
};
use types::{test_utils::generate_deterministic_keypair, AttestationData, BeaconBlockHeader};
pub const DEFAULT_VALIDATOR_INDEX: usize = 0;
pub const DEFAULT_DOMAIN: Hash256 = Hash256::zero();