mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 06:44:35 +00:00
Rust 1.84 lints (#6781)
* Fix few lints * Fix remaining lints * Use fully qualified syntax
This commit is contained in:
@@ -523,7 +523,7 @@ impl<E: EthSpec> Tester<E> {
|
||||
|| Ok(()),
|
||||
))?
|
||||
.map(|avail: AvailabilityProcessingStatus| avail.try_into());
|
||||
let success = blob_success && result.as_ref().map_or(false, |inner| inner.is_ok());
|
||||
let success = blob_success && result.as_ref().is_ok_and(|inner| inner.is_ok());
|
||||
if success != valid {
|
||||
return Err(Error::DidntFail(format!(
|
||||
"block with root {} was valid={} whilst test expects valid={}. result: {:?}",
|
||||
|
||||
@@ -322,7 +322,7 @@ impl<E: EthSpec> Operation<E> for BeaconBlockBody<E, FullPayload<E>> {
|
||||
let valid = extra
|
||||
.execution_metadata
|
||||
.as_ref()
|
||||
.map_or(false, |e| e.execution_valid);
|
||||
.is_some_and(|e| e.execution_valid);
|
||||
if valid {
|
||||
process_execution_payload::<E, FullPayload<E>>(state, self.to_ref(), spec)
|
||||
} else {
|
||||
@@ -377,7 +377,7 @@ impl<E: EthSpec> Operation<E> for BeaconBlockBody<E, BlindedPayload<E>> {
|
||||
let valid = extra
|
||||
.execution_metadata
|
||||
.as_ref()
|
||||
.map_or(false, |e| e.execution_valid);
|
||||
.is_some_and(|e| e.execution_valid);
|
||||
if valid {
|
||||
process_execution_payload::<E, BlindedPayload<E>>(state, self.to_ref(), spec)
|
||||
} else {
|
||||
|
||||
@@ -28,7 +28,7 @@ pub fn log_file_access<P: AsRef<Path>>(file_accessed: P) {
|
||||
|
||||
writeln!(&mut file, "{:?}", file_accessed.as_ref()).expect("should write to file");
|
||||
|
||||
file.unlock().expect("unable to unlock file");
|
||||
fs2::FileExt::unlock(&file).expect("unable to unlock file");
|
||||
}
|
||||
|
||||
pub fn yaml_decode<T: serde::de::DeserializeOwned>(string: &str) -> Result<T, Error> {
|
||||
|
||||
Reference in New Issue
Block a user