Sitemap
Nelson Júnior

Nelson Júnior

Software Engineer

Rust Macros power

1 min readJul 12, 2020

Today I'm started to solve some exercises in exercism.io.

Get Nelson Júnior’s stories in your inbox

Join Medium for free to get updates from this writer.

In Raindrops exercise I wrote the first code to pass all tests. The code above is not too much.

I’m not happy with this code, because body functions are similar enough. Although it works and I know there are Macros in the Rust lang, but I never created one, and I found the moment to learn about and apply. :).

Reference:

https://doc.rust-lang.org/1.7.0/book/macros.html

--

--