rust-lang / cfg-if

A if/elif-like macro for Rust #[cfg] statements
Apache License 2.0
557 stars 40 forks source link

More readable formatting and identifier names. #39

Closed msmorgan closed 3 years ago

msmorgan commented 3 years ago

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.

alexcrichton commented 3 years ago

Looks great to me, thanks!

chris-morgan commented 2 years ago

I was just reviewing this crate and thought it worthwhile to note two things about this: