unascribed / FlexVer

A SemVer-compatible intuitive comparator for free-form versioning strings as seen in the wild, designed to sort versions like people do.
Creative Commons Zero v1.0 Universal
65 stars 10 forks source link

Cleanup FlexVer-rs #6

Closed BD103 closed 1 year ago

BD103 commented 1 year ago

I looked over the Rust implementation and fixed a few small details. I also ran Clippy over the code, which found even more small details to fix.

Because I realized that some changes might be reversed in the future, I split every single change into a separate commit so that it can be cherry-picked. (This is why there are 8 tiny commits lol)

I've run Rustfmt and the test suite already, and it all passes. All changes also only affect the private API, so this can be released in a patch release instead of a minor release.

If you have any questions, feel free to reach out to me on this PR. :)

unascribed commented 1 year ago

The toolchain pin does appear to be necessary. I've never tried to build the Rust port, so.

image

Infinidoge commented 1 year ago

Evidently in writing it I depended on nightly features. In hindsight it's obvious, but thankfully it isn't too difficult to remove. @BD103 Do you mind if I force-push to your branch to remove the toolchain file commit and add my fixes (+ version stuff)?

BD103 commented 1 year ago

@Infinidoge feel free to force push what you need. I believe the Pattern API can be replaced with iterators, specifically with Chars and Peekable, but it also will be a little bit more code than what is currently there.

Infinidoge commented 1 year ago

My usage of Pattern was more so because I wanted clean-feeling code, rather than anything actually important. Also manually squashed the commits myself, so I could edit the message a bit.

I'll take care of removing the nightly dependency and bumping the version in my own commits, just to keep the history a bit cleaner.

BD103 commented 1 year ago

Cool! I'm glad I could help out :D