ok_or
This commit is contained in:
parent
dc229363af
commit
cfff3c39b9
@ -83,13 +83,13 @@ impl<'a, Ctx: Context<'a>> SingularResolver<'a, Ctx> {
|
|||||||
self: Arc<Self>,
|
self: Arc<Self>,
|
||||||
address: Address,
|
address: Address,
|
||||||
) -> Result<HashResolution<'a, Ctx>, SingularityError> {
|
) -> Result<HashResolution<'a, Ctx>, SingularityError> {
|
||||||
let point =
|
let point = self
|
||||||
self.points
|
.points
|
||||||
.get(address.index)
|
.get(address.index)
|
||||||
.ok_or_else(|| SingularityError::OutOfBounds {
|
.ok_or(SingularityError::OutOfBounds {
|
||||||
index: address.index,
|
index: address.index,
|
||||||
len: self.points.len(),
|
len: self.points.len(),
|
||||||
})?;
|
})?;
|
||||||
if point.s_hash() != address.point {
|
if point.s_hash() != address.point {
|
||||||
Err(SingularityError::Mismatch {
|
Err(SingularityError::Mismatch {
|
||||||
index: address.index,
|
index: address.index,
|
||||||
|
Loading…
Reference in New Issue
Block a user