use truncate, not pop (#1837)
This commit is contained in:
parent
054d0a6b19
commit
c3473e5631
@ -556,13 +556,7 @@ impl<I, C, R, SC> HasCurrentStage for StdState<I, C, R, SC> {
|
||||
}
|
||||
|
||||
fn clear_stage(&mut self) -> Result<(), Error> {
|
||||
self.stage_idx_stack.pop();
|
||||
// ensure we are in the right frame
|
||||
if self.stage_depth != self.stage_idx_stack.len() {
|
||||
return Err(Error::illegal_state(
|
||||
"we somehow cleared too many or too few states!",
|
||||
));
|
||||
}
|
||||
self.stage_idx_stack.truncate(self.stage_depth);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user