mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Replace lazy_static! with LazyLock (#6189)
* Replace `lazy_static` with `LazyLock`. * Merge branch 'unstable' into remove-lazy-static # Conflicts: # beacon_node/lighthouse_network/src/peer_manager/mod.rs * Lint fixes. * Merge branch 'unstable' into remove-lazy-static # Conflicts: # beacon_node/beacon_chain/src/metrics.rs * Moar lint fixes. * Update rust version to 1.80.0. * Merge branch 'unstable' into remove-lazy-static
This commit is contained in:
@@ -7,7 +7,6 @@ edition = { workspace = true }
|
||||
[dependencies]
|
||||
ethereum-types = { workspace = true }
|
||||
ethereum_hashing = { workspace = true }
|
||||
lazy_static = { workspace = true }
|
||||
safe_arith = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES};
|
||||
use ethereum_types::H256;
|
||||
use lazy_static::lazy_static;
|
||||
use safe_arith::ArithError;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
const MAX_TREE_DEPTH: usize = 32;
|
||||
const EMPTY_SLICE: &[H256] = &[];
|
||||
|
||||
lazy_static! {
|
||||
/// Zero nodes to act as "synthetic" left and right subtrees of other zero nodes.
|
||||
static ref ZERO_NODES: Vec<MerkleTree> = {
|
||||
(0..=MAX_TREE_DEPTH).map(MerkleTree::Zero).collect()
|
||||
};
|
||||
}
|
||||
/// Zero nodes to act as "synthetic" left and right subtrees of other zero nodes.
|
||||
static ZERO_NODES: LazyLock<Vec<MerkleTree>> =
|
||||
LazyLock::new(|| (0..=MAX_TREE_DEPTH).map(MerkleTree::Zero).collect());
|
||||
|
||||
/// Right-sparse Merkle tree.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user