Skip to content

semver: ignore build metadata #12438

@omasanori

Description

@omasanori
Contributor

To provide strict total ordering for semver::Version, build metadata must be ignored for equality. Which way is preferred?

  • Preserve build metadata in Version but equality checking ignores it.
    • Most of behaviors are preserved.
  • Remove build metadata field from Version and the parser ignores it.
    • format!("{}", parse("1.0.0+build.1").unwrap()) == "1.0.0"

cc #12435

Activity

erickt

erickt commented on Feb 21, 2014

@erickt
Contributor

I we should keep the build data and exclude it from the equality and ordering check. That way we can convert a version back into a string.

omasanori

omasanori commented on Feb 21, 2014

@omasanori
ContributorAuthor

@erickt Sure.

added a commit that references this issue on Mar 20, 2023
7c05f55
added 2 commits that reference this issue on Mar 21, 2024
b44ab66
7ee75f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @erickt@omasanori

      Issue actions

        semver: ignore build metadata · Issue #12438 · rust-lang/rust