DEV Community

Discussion on: Simple Rust Macros:

Collapse
 
chayimfriedman2 profile image
Chayim Friedman

You should avoid macros as much as you can. All of your examples can be rewritten to use functions, and it is a much better approach (plus, it saves the ! keystroke!). Macros are needed when we want to perform some syntactical transformation otherwise impossible.