Skip to content

Comment on Rust's Two Kinds of 'Assert' Make for Better Codeparent

Comments

I would say no. In fact it is risky, because if you try to add an assertion message inside the parens you’re now asserting a non-empty tuple which is always truthy. Though obviously you might know enough to not make this error, and want the parens for consistency when asserts need to be multiline.

tratt might also be doing that more for consistency with the desugaring than as a routine behaviour.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.