Skip to content

fix for issue #585

Michael Aaron Murphy requested to merge covercash2:master into master

Created by: covercash2

Solution:

the level: u8 variable in the Iterator::next implementation for the ArgumentSplitter was being decremented when its value was 0, causing a panic (unsigned ints cannot be less than 0).

Changes introduced by this pull request

i assumed that level represented the depth of the parentheses, so i consolidated the handling of parentheses and added level +=1 or level -= 1 respectively.

i also refactored the raw bit flags to use the bitflags crate for a few reason:

  1. the crate was already imported
  2. it makes the code a lot more readable (to me at least)
  3. it helped me understand the code

Drawbacks

i just assumed level was referring to the parenthesis level, but i could be wrong. if that's the case this pull request should be rejected.

Merge request reports