mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Rust 1.85 lints (#7019)
N/A 2 changes: 1. Replace Option::map_or(true, ...) with is_none_or(...) 2. Remove unnecessary `Into::into` blocks where the type conversion is apparent from the types
This commit is contained in:
@@ -903,7 +903,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
||||
state_root: &Hash256,
|
||||
summary: HotStateSummary,
|
||||
) -> Result<(), Error> {
|
||||
self.hot_db.put(state_root, &summary).map_err(Into::into)
|
||||
self.hot_db.put(state_root, &summary)
|
||||
}
|
||||
|
||||
/// Store a state in the store.
|
||||
@@ -1248,7 +1248,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
||||
state_root.as_slice().to_vec(),
|
||||
));
|
||||
|
||||
if slot.map_or(true, |slot| slot % E::slots_per_epoch() == 0) {
|
||||
if slot.is_none_or(|slot| slot % E::slots_per_epoch() == 0) {
|
||||
key_value_batch.push(KeyValueStoreOp::DeleteKey(
|
||||
DBColumn::BeaconState,
|
||||
state_root.as_slice().to_vec(),
|
||||
|
||||
@@ -195,7 +195,6 @@ pub trait ItemStore<E: EthSpec>: KeyValueStore<E> + Sync + Send + Sized + 'stati
|
||||
let key = key.as_slice();
|
||||
|
||||
self.put_bytes(column, key, &item.as_store_bytes())
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
fn put_sync<I: StoreItem>(&self, key: &Hash256, item: &I) -> Result<(), Error> {
|
||||
@@ -203,7 +202,6 @@ pub trait ItemStore<E: EthSpec>: KeyValueStore<E> + Sync + Send + Sized + 'stati
|
||||
let key = key.as_slice();
|
||||
|
||||
self.put_bytes_sync(column, key, &item.as_store_bytes())
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Retrieve an item from `Self`.
|
||||
|
||||
Reference in New Issue
Block a user