Remove expect

This commit is contained in:
Michael Sproul
2026-03-26 10:48:18 +11:00
parent 9f1f68c3ee
commit a69a848590
2 changed files with 2 additions and 1 deletions

View File

@@ -60,6 +60,7 @@ pub enum Error {
BrokenBlock { BrokenBlock {
block_root: Hash256, block_root: Hash256,
}, },
NoViableChildren,
} }
impl From<ArithError> for Error { impl From<ArithError> for Error {

View File

@@ -1338,7 +1338,7 @@ impl ProtoArray {
(*weight, child.root, *payload_status_tiebreaker) (*weight, child.root, *payload_status_tiebreaker)
}) })
.map(|(child, _, _)| child) .map(|(child, _, _)| child)
.expect("children is non-empty"); .ok_or(Error::NoViableChildren)?;
} }
} }