mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(trie): TrieOp::as_update (#9076)
This commit is contained in:
@ -38,6 +38,15 @@ impl TrieOp {
|
||||
pub const fn is_update(&self) -> bool {
|
||||
matches!(self, Self::Update(..))
|
||||
}
|
||||
|
||||
/// Returns reference to updated branch node if operation is [`Self::Update`].
|
||||
pub const fn as_update(&self) -> Option<&BranchNodeCompact> {
|
||||
if let Self::Update(node) = &self {
|
||||
Some(node)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The aggregation of trie updates.
|
||||
|
||||
Reference in New Issue
Block a user