Skip to content

Commit 1a3a8dc

Browse files
committed
fix: static stack returning invalid value on pop_value
1 parent 6e39738 commit 1a3a8dc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["bmatcher", "bmatcher-core", "bmatcher-proc", "example"]
44

55
[workspace.package]
6-
version = "0.2.0"
6+
version = "0.2.1"
77
authors = ["Markus Hadenfeldt <[email protected]>"]
88
edition = "2021"
99
description = "bmatcher is a flexible and efficient binary pattern matching library designed to help you search and match binary data."

bmatcher-core/src/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ impl<const N: usize, T: Default + Copy> Stack<T> for StaticStack<N, T> {
5555

5656
fn pop_value(&mut self) -> Option<T> {
5757
if self.length > 0 {
58-
let value = self.stack[self.length];
5958
self.length -= 1;
59+
let value = self.stack[self.length];
6060
Some(value)
6161
} else {
6262
None

0 commit comments

Comments
 (0)