Re:SwiftWasm: Run Swift in Browsers
by gamegoblin on Friday May 10, 2019 @06:13PM
(#19882758)
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.
[ Parent
| on HN ]
Re:SwiftWasm: Run Swift in Browsers
by newacctjhro on Friday May 10, 2019 @07:35PM
(#19883272)
This kind of stuff should be on the stdlib if it's meant to be idiomatic.
Re:SwiftWasm: Run Swift in Browsers
by gamegoblin on Friday May 10, 2019 @07:58PM
(#19883417)
Rust 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.