Comments (7)
Here's the core of it:
[AlphaNumeric("really"), AlphaNumeric("0")] == [AlphaNumeric("really"), Numeric(0)]
these are not considered equal for some reason
from semver.
So the root of the issue is multiple pre sections. With just -really
, this works.
from semver.
Hrm, so https://play.rust-lang.org/?gist=f399089d777f3fc4effd&version=stable
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum Identifier {
/// An identifier that's solely numbers.
Numeric(u64),
/// An identifier with letters and numbers.
AlphaNumeric(String)
}
I am confused as to how these two differ. We only use derive
for {Partial,}Eq
, so...
from semver.
Using the same definitions also works: https://play.rust-lang.org/?gist=cffbc41f771a38132c79&version=stable
ugh.
from semver.
OH: AlphaNumeric("0")
vs Numeric(0)
Somehow, these two versions are being parsed differently. That's the problem.
from semver.
Adjusting the test:
let v1 = VersionReq::parse("2.1.1-really.0").unwrap();
let v2 = Version::parse("2.1.1-really.0").unwrap();
println!("v1: {:?}", v1);
println!("v2: {:?}", v2);
gives
v1: VersionReq { predicates: [Predicate { op: Compatible, major: 2, minor: Some(1), patch: Some(1), pre: [AlphaNumeric("really"), AlphaNumeric("0")] }] }
v2: Version { major: 2, minor: 1, patch: 1, pre: [AlphaNumeric("really"), Numeric(0)], build: [] }
So, it's that VersionReq
parsing has a bug: it thinks that 0
is an AlphaNumeric
when it should be a Numeric
.
If only I had done that nom
port already, I bet this wouldn't have happened :(
from semver.
PR submitted
from semver.
Related Issues (20)
- nonzero_leading_trailing_zeros requires rustc 1.53.0 HOT 1
- Error using unstable feature: nonzero_leading_trailing_zeros in nightly rust HOT 2
- Error about an unstable lint HOT 1
- Wildcard VersionReq alongside other requirements HOT 3
- `is_exact`? HOT 2
- Display impl for Version no longer supports padding
- 1.0.4 broke older nightlies HOT 1
- Why is Op non-exhaustive? HOT 1
- Doc/test requests from an audit from a vendor crate bump HOT 1
- Unable to parse v0.0.1-001 HOT 1
- Negation operator HOT 1
- v1.0.8 breaks Send/Sync impls on some public structs HOT 1
- Please yank version 1.0.8 when you get the chance HOT 1
- Implementation for range with multiple look buged when pre-release are not present HOT 1
- `cargo doc` emits errors, but then works anyway
- Error when cargo fuzz HOT 1
- Pre-release requirement not satisfied HOT 2
- `Identifier::new_unchecked()` writes to null pointer on allocation failure HOT 2
- Implement Ord for VersionReq? HOT 1
- Version Mutability HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semver.