It was just a quick solution showing how to do it with one macro and zero dependencies, utilizing the power of meta variables. It probably can be made nicer.
Side Note: It's not directly relevant/needed here, but this also shows that maybe a theoretical $reverse{} meta variable can be useful with repeated patterns, to in this case generate the variants in the expected order.
6 Comments
Vorpal@programming.dev · 3 pts · 196d
Uh, this blog says "introducing", but this is hardly new. I have seen this crate around for a while, and https://crates.io/crates/crabtime/versions corroborates that.
Is this an old blog? I can't find a date on it.
SorteKanin@feddit.dk · 1 pts · 196d
Might not be new but it's not been posted here before :)
jenesaisquoi@feddit.org · 2 pts · 185d
Doesn't support derive macros, unfortunately.
MoSal@programming.dev · 2 pts · 196d
(slightly edited from initial version)
SorteKanin@feddit.dk · 2 pts · 196d
Not nearly as readable though
MoSal@programming.dev · 4 pts · 196d
It was just a quick solution showing how to do it with one macro and zero dependencies, utilizing the power of meta variables. It probably can be made nicer.
Side Note: It's not directly relevant/needed here, but this also shows that maybe a theoretical
$reverse{}meta variable can be useful with repeated patterns, to in this case generate the variants in the expected order.