Giter Club home page Giter Club logo

Comments (9)

anguslees avatar anguslees commented on August 21, 2024 1

+1. I want to parse a semver and express the implied min/max constraints in a similar constraint syntax (Debian packaging metadata). It'd be real nice if VersionReq predicates were exposed in some way to prevent me having to duplicate all that parsing logic.

from semver.

joshtriplett avatar joshtriplett commented on August 21, 2024

It looks like semver-parser provides the ability to introspect into its version of VersionReq, but semver has its own version of VersionReq that doesn't allow introspection.

Could semver just use the types from semver-parser, rather than converting to its own?

from semver.

steveklabnik avatar steveklabnik commented on August 21, 2024

Could semver just use the types from semver-parser, rather than converting to its own?

I would say yes, but in a slightly different way: they should still convert over, but we should evolve VersionReq to be more useful.

Now that we've fully converted over, I want to take a hard look at the whole interface, looking towards a 1.0. These kinds of changes are the things I might want to make.

from semver.

joshtriplett avatar joshtriplett commented on August 21, 2024

@steveklabnik Why the separate types and conversion between them?

from semver.

steveklabnik avatar steveklabnik commented on August 21, 2024

They're two separate crates, the conversion means that I don't leak the specific semver-parser into semver's external API.

from semver.

joshtriplett avatar joshtriplett commented on August 21, 2024

Is there a strong reason to keep them separate rather than unifying them?

from semver.

steveklabnik avatar steveklabnik commented on August 21, 2024

I like small crates, and keeping concerns separate. One crate for one thing; one handles the conversions, the other has all of the logic for comparisons, etc. it feels like the split between -sys and not to me. Plus, there could be other back ends: maybe that nom parser I tried would work better, or LALRPOP.

But! Part of that is the beauty of < 1.0: I'm not actually sure. We'll see.

On Aug 8, 2016, 19:23 -0400, Josh Triplett [email protected], wrote:

Is there a strong reason to keep them separate rather than unifying them?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#59 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AABsio9cOyLsza_0So_cP-amaGhkpa0Hks5qd7pbgaJpZM4GfolK).

from semver.

opilar avatar opilar commented on August 21, 2024

I don't know how it could be implemented: for now VersionReq is just a bunch of Predicate's. For me it's not clear how to get a min and max constrains.
How can VersionReq be exposed actually?

from semver.

dtolnay avatar dtolnay commented on August 21, 2024

This is now available in 1.0.0. https://docs.rs/semver/1.0.0-rc.1/semver/struct.VersionReq.html

from semver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.