Fix checked_get
This commit is contained in:
parent
a8f574bd80
commit
e9ef4db202
@ -510,8 +510,9 @@ impl<'a> Calculator<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn checked_get(&self, idx: usize) -> CalculatorResult<f64> {
|
fn checked_get(&self, idx: usize) -> CalculatorResult<f64> {
|
||||||
self.stack
|
match self.stack.get(idx) {
|
||||||
.get(idx)
|
None => Err(CalculatorError::NotEnoughStackEntries),
|
||||||
.ok_or(Err(CalculatorError::NotEnoughStackEntries))
|
Some(r) => Ok(*r),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user