Skip to content

Commit bdeea80

Browse files
committed
allow stacks to be full
1 parent 169a0cf commit bdeea80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ where
115115
}
116116

117117
fn push(&mut self, x: T) -> Result<(), StackError> {
118-
if self.head + 1 >= self.data.len() {
118+
if self.head >= self.data.len() {
119119
return Err(StackError::Overflow);
120120
}
121121

0 commit comments

Comments
 (0)