3 ms·
I frequently define a `guard!` macro in Rust that does exactly that. Seems clean enough to solve at the macro level -- doesn't necessarily need to be built into
by gamegoblin 7y ago
I frequently define a `guard!` macro in Rust that does exactly that. Seems clean enough to solve at the macro level -- doesn't necessarily need to be built into the language itself.
- newacctjhro 7y agoThis kind of stuff should be on the stdlib if it's meant to be idiomatic.
- gamegoblin 7y agoRust errs on the side of not putting things in the stdlib. Even things like random number generation or regexes are not in stdlib. The excellent package manager (Cargo) makes this a non-issue.