Potentially valid, not always valid.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
projectmoon 2021-09-26 23:19:51 +00:00
parent 0cb48bea07
commit ef5b4cb69b
1 changed files with 2 additions and 2 deletions

View File

@ -84,12 +84,12 @@ fn parse_keep_or_drop<'a>(input: &'a str, count: u32) -> IResult<&'a str, KeepOr
use ParsedKeepOrDrop::*;
let keep_drop: KeepOrDrop = match (keep, drop) {
//Valid Keep expression.
//Potential valid Keep expression.
(Keep(keep), NotPresent) => match keep.parse().map_err(|_| too_big!(input))? {
_i if _i > count || _i == 0 => Ok(KeepOrDrop::None),
i => Ok(KeepOrDrop::Keep(i)),
},
//Valid Drop expression.
//Potential valid Drop expression.
(NotPresent, Drop(drop)) => match drop.parse().map_err(|_| too_big!(input))? {
_i if _i >= count => Ok(KeepOrDrop::None),
i => Ok(KeepOrDrop::Drop(i)),