-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"*" is not equal to any() #161
Comments
Looks like we might need to implement equality traits manually by calling |
I don't think there's anything wrong with the equality traits. It looks like I added: println!("{:?}\n{:?}", any, star); to @dtolnay's test program. The output is interesting: * * false
VersionReq { predicates: [] }
VersionReq { predicates: [Predicate { op: Wildcard(Major), major: 0, minor: None, patch: None, pre: [] }] } Definitely not the same 😨, but it should be. I've spent some time trying to debug this but I wonder if it could be something to do with the crate boundary between
tl;dr -- |
It's even worse: the star does not work as expected. let req = VersionReq::parse("*").unwrap();
let vers = Version::parse("0.1.0-beta");
assert!(req.matches(&vers)); // ??? !!! |
So, as pointed out by @agalakhov , The |
This is fixed in 1.0.0. "Any" is no longer a thing, because there is no SemVer syntax that behaves that way. "Star" is a different thing and is exposed as https://docs.rs/semver/1.0.0-rc.1/semver/struct.VersionReq.html#associatedconstant.STAR. If someone needs the semantics of sometimes always matching everything, then they should use |
I would expect the following program to print
* * true
. Instead it prints* * false
.The text was updated successfully, but these errors were encountered: