timothee-haudebourg / range-traits

Ranges related traits for Rust.
0 stars 1 forks source link

Make no_std, remove unsafe code for core types #2

Closed clarfonthey closed 1 year ago

clarfonthey commented 1 year ago

Separated into three commits:

1. cargo fmt missed the hard tabstops in macros, making the crate use both four spaces and tabs. This replaces the tabs for consistency. Replaced by new upstream commit which uses tabs everywhere.

  1. The implementations of pred and succ use a hand-rolled implementation with unsafe code; we can leverage the already existing implementation in libstd by using ranges.
  2. Replacing the remaining std paths with core lets us just mark the entire crate as no_std
  3. To better reflect other operator traits, Measure<U> is now Measure<Rhs>. Also, Rhs: ?Sized for symmetry.
timothee-haudebourg commented 1 year ago

Hey, thanks for your contributions I like those ideas. However in general I would prefer those multiple PRs for multiple changes. I guess its not really an issue for 1, 2 and 3, ~but 4 is a breaking change, so we should definitely discuss that in another PR, can you do that?~ Sorry I misread, I thought you turned the type parameter into an associated type. Its fine then.

timothee-haudebourg commented 1 year ago

Also I've added a rustfmt configuration file and a CI workflow, so you'll need to rebase your changes.

clarfonthey commented 1 year ago

All good! Yeah, I bundled them all together since none of them were breaking, and I understand that the reformatting definitely made it more confusing. Looks way easier to understand now.

timothee-haudebourg commented 1 year ago

You've been quick, maybe too much: I've found that the github repo was a little behind the crates.io version (0.2 instead of 0.3). I've fixed it, but that means you'll have to rebase once again, sorry.

clarfonthey commented 1 year ago

Heh, all good. I actually just noticed this by happenstance, so, it's funny that it happened so quickly.

Rebase seems to work fine without any extra work, so, I'll wait and see that CI works too.

timothee-haudebourg commented 1 year ago

Published with version 0.3.2