You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it looks like rustfmt always inserts a semicolon after break, return, and continue expressions. Given that it is semantically invalid to include code after these expressions, why not make it syntactically invalid as well? That is, the only typical need for inserting a semicolon is to change some type to () or to allow writing another statement, but in the case of these expressions there's no need to do either (and you save a character to boot).
Maybe this is better waiting for the RFC process, though?
The text was updated successfully, but these errors were encountered:
Yeah, this should go through the RFC process. I'll leave the issue open since we should make this a config option.
I prefer semicolons after these expressions since I think it is consistent to have return x; and return; (or even return ();), but this is pretty subjective.
Right now it looks like rustfmt always inserts a semicolon after
break
,return
, andcontinue
expressions. Given that it is semantically invalid to include code after these expressions, why not make it syntactically invalid as well? That is, the only typical need for inserting a semicolon is to change some type to()
or to allow writing another statement, but in the case of these expressions there's no need to do either (and you save a character to boot).Maybe this is better waiting for the RFC process, though?
The text was updated successfully, but these errors were encountered: