mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 21:34:46 +00:00
1.57.0 lints (#2850)
## Issue Addressed New rust lints ## Proposed Changes - Boxing some enum variants - removing some unused fields (is the validator lockfile unused? seemed so to me) ## Additional Info - some error fields were marked as dead code but are logged out in areas - left some dead fields in our ef test code because I assume they are useful for debugging? Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
@@ -777,7 +777,7 @@ pub struct SseLateHead {
|
||||
#[derive(PartialEq, Debug, Serialize, Clone)]
|
||||
#[serde(bound = "T: EthSpec", untagged)]
|
||||
pub enum EventKind<T: EthSpec> {
|
||||
Attestation(Attestation<T>),
|
||||
Attestation(Box<Attestation<T>>),
|
||||
Block(SseBlock),
|
||||
FinalizedCheckpoint(SseFinalizedCheckpoint),
|
||||
Head(SseHead),
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
|
||||
/// outage) caused the lockfile not to be deleted.
|
||||
#[derive(Debug)]
|
||||
pub struct Lockfile {
|
||||
file: File,
|
||||
_file: File,
|
||||
path: PathBuf,
|
||||
file_existed: bool,
|
||||
}
|
||||
@@ -43,7 +43,7 @@ impl Lockfile {
|
||||
_ => LockfileError::IoError(path.clone(), e),
|
||||
})?;
|
||||
Ok(Self {
|
||||
file,
|
||||
_file: file,
|
||||
path,
|
||||
file_existed,
|
||||
})
|
||||
|
||||
@@ -99,7 +99,7 @@ impl<'a> AlignedRecordDecorator<'a> {
|
||||
|
||||
impl<'a> Write for AlignedRecordDecorator<'a> {
|
||||
fn write(&mut self, buf: &[u8]) -> Result<usize> {
|
||||
if buf.iter().any(|c| is_ascii_control(c)) {
|
||||
if buf.iter().any(u8::is_ascii_control) {
|
||||
let filtered = buf
|
||||
.iter()
|
||||
.cloned()
|
||||
|
||||
@@ -128,7 +128,7 @@ impl MonitoringHttpClient {
|
||||
Error::BeaconMetricsFailed("Beacon metrics require db path".to_string())
|
||||
})?;
|
||||
|
||||
let freezer_db_path = self.db_path.as_ref().ok_or_else(|| {
|
||||
let freezer_db_path = self.freezer_db_path.as_ref().ok_or_else(|| {
|
||||
Error::BeaconMetricsFailed("Beacon metrics require freezer db path".to_string())
|
||||
})?;
|
||||
let metrics =
|
||||
|
||||
@@ -63,7 +63,7 @@ pub struct Eth1DepositData {
|
||||
pub struct ValidatorDir {
|
||||
dir: PathBuf,
|
||||
#[derivative(PartialEq = "ignore")]
|
||||
lockfile: Lockfile,
|
||||
_lockfile: Lockfile,
|
||||
}
|
||||
|
||||
impl ValidatorDir {
|
||||
@@ -85,7 +85,10 @@ impl ValidatorDir {
|
||||
let lockfile_path = dir.join(format!("{}.lock", VOTING_KEYSTORE_FILE));
|
||||
let lockfile = Lockfile::new(lockfile_path).map_err(Error::LockfileError)?;
|
||||
|
||||
Ok(Self { dir, lockfile })
|
||||
Ok(Self {
|
||||
dir,
|
||||
_lockfile: lockfile,
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns the `dir` provided to `Self::open`.
|
||||
|
||||
Reference in New Issue
Block a user