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
if the type is required there, then it is able to be shorted to.
letmut(a, b, c, d):bool = false;
I have thought of making bool and false there a bit more obvious like the JS style spread(not really the spreading meaning here though): (false..) and (bool..) or using other notations like x!(bool) and [bool], and etc., but I think that keeping the simple form is good enough and because it does not seem to induce much misleadings while reading .
The text was updated successfully, but these errors were encountered:
For mut shorthand, there is a previous rfc and discussion in rust-lang/rfcs#2401
jonas-schievink
added
the
needs-rfc
This change is large or controversial enough that it should have an RFC accepted before doing it.
label
Sep 19, 2019
Hi! Large additions to the language or standard library need to go through our RFC process. Before an RFC is written, the feature can also be discussed in our internals forum to find other people interested in it.
When we have multiple variable to be declared, we need to write something like this:
There are two obvious factorizations:
The first part is to factorize the
mut
decorator, so to belet mut (a, b, c, d)
.Another part is to spread the value tuple, so to be
false
.That
is short while intuitive.
Last, in the long form
if the type is required there, then it is able to be shorted to.
I have thought of making
bool
andfalse
there a bit more obvious like the JS style spread(not really the spreading meaning here though):(false..)
and(bool..)
or using other notations likex!(bool)
and[bool]
, and etc., but I think that keeping the simple form is good enough and because it does not seem to induce much misleadings while reading .The text was updated successfully, but these errors were encountered: