-
-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
Description
Hi! This code:
use semver::Version;
fn main() {
let a = Version::parse("0.0.0+a").unwrap();
let b = Version::parse("0.0.0+b").unwrap();
dbg!(a.cmp(&b));
}
currently prints
[src/main.rs:6] a.cmp(&b) = Less
According to SemVer 2.0.0 # 10, comparing versions should ignore build metadata. Including it in this comparison also create an inconsistency with VersionReq
and makes cargo consider version change from 0.0.0+b
to 0.0.0+a
downgrading.
Crate documentation also suggests that implementation of Ord
for BuildMetadata
is only to allow comparing two BuildMetadata
values and shouldn’t affect versions.
nerodono, Ternvein and stanislav-tkach
Metadata
Metadata
Assignees
Labels
No labels