diff --git a/src/range.rs b/src/range.rs index c4baa82..bbd6e3c 100644 --- a/src/range.rs +++ b/src/range.rs @@ -10,7 +10,7 @@ use nom::multi::{many_till, separated_list0}; use nom::sequence::{delimited, preceded, terminated, tuple}; use nom::{Err, IResult}; -use crate::{extras, number, Identifier, SemverError, SemverErrorKind, SemverParseError, Version}; +use crate::{extras, number, Identifier, SemverError, SemverErrorKind, SemverParseError, Version, MAX_SAFE_INTEGER}; #[derive(Clone, Debug, Eq, PartialEq, Hash)] struct BoundSet { @@ -633,6 +633,17 @@ fn primitive(input: &str) -> IResult<&str, Option, SemverParseError<&s build, pre_release, })), + ( + LessThanEquals, + Partial { + major, + minor: None, + patch: None, + .. + }, + ) => BoundSet::at_most(Predicate::Including( + (major.unwrap_or(0), MAX_SAFE_INTEGER, MAX_SAFE_INTEGER).into(), + )), ( LessThanEquals, Partial { @@ -642,7 +653,7 @@ fn primitive(input: &str) -> IResult<&str, Option, SemverParseError<&s .. }, ) => BoundSet::at_most(Predicate::Including( - (major.unwrap_or(0), minor.unwrap_or(0), 0, 0).into(), + (major.unwrap_or(0), minor.unwrap_or(0), MAX_SAFE_INTEGER).into(), )), (LessThanEquals, partial) => { BoundSet::at_most(Predicate::Including(partial.into()))