Skip to content

Commit

Permalink
fix: fix condition for removing element from queue
Browse files Browse the repository at this point in the history
  • Loading branch information
anstadnik committed Jun 29, 2023
1 parent 47189f9 commit c5939a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/tests/test_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ fn test_md(s: &str) -> Result<()> {
let re = Regex::new(r"(```|\|\||__|`|\*|_|~)").unwrap();
let mut q: VecDeque<&str> = VecDeque::new();
for mat in re.find_iter(s) {
let prev_i = mat.start() - 1;
if mat.start() == 0 || !s.is_char_boundary(prev_i) || &s[prev_i..mat.start()] != "\\" {
if mat.start() == 0
|| !s.is_char_boundary(mat.start() - 1)
|| &s[(mat.start() - 1)..mat.start()] != "\\"
{
if q.back() == Some(&mat.as_str()) {
q.pop_back();
} else {
Expand Down

0 comments on commit c5939a5

Please sign in to comment.