Closed msmorgan closed 3 years ago
Looks great to me, thanks!
I was just reviewing this crate and thought it worthwhile to note two things about this:
*
to $(…)else+
is a breaking change, even if it is of unintended behaviour (see #23). I recommend reverting that one character change, because I can imagine realistic code that it will break, or calling the next release 2.0.0.*
to ?
changes no functionality but increases the minimum supported Rust version from probably 1.31.0 to 1.32.0. (1.31.0 only because it’s marked edition 2018; otherwise I think it’d run on 1.0.0; I can’t remember what Cargo did back at 1.0.0 with unknown keys like edition, whether it errored or allowed them.)
This macro provides a a great example for developers learning macros to study. It's easy to discover, since libstd and many other crates depend on it, and the macro itself illustrates a number of useful concepts. This commit reformats some code to make the brackets easier to see, and renames a few identifiers for clarity.
Additionally, the
+
and?
repetition quantifiers have been used where appropriate instead of*
, and an extra( () () )
item has been removed, which had no effect.