For A/B testing, I use this in C++; it looks like it works in rust (according to my syntax highlighter):
//* //add/delete the first slash to toggle these blocks
fooA();
/*/
fooB();
/**/
Re:Rust Bug Minimization Patterns
by FartyMcFarter on Friday November 22, 2019 @07:59PM
(#21611659)
I like this for C/C++:
#if 1 // or 0
A
#else
B
#endif
This can even be nested.This is so overwhelmingly better in every conceivable way that there is no excuse for ever using the other thing. (Unless you are using Rust and don't have it?)
Yeah, that's good too. When I don't need nesting, I like toggleable comments because the inactive block gets grayed out.
Re:Rust Bug Minimization Patterns
by FartyMcFarter on Saturday November 23, 2019 @06:57AM
(#21613685)
Some editors like vim also grey out the text with "#if".
Try:
remove the space on the first line to re-enable it.