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
Instead we have a "maybe" type, perhaps by putting a question mark before another type, like this:
?*mut u8
This represents a tagged union which can either be None or a *mut u8 which is guaranteed to not be null. You could .unwrap() on a maybe type to resolve to a non-null type, or panic.
Also, a ?? operator which the left operand is a maybe type and the right operand is an expression which is of the unwrapped type. So you could for example:
fnfunc(x : ?bool) {
letwant_the_thing=x??true;
}
Now you have an optional boolean that has a default value of true.
?
syntax for declaring a maybe type??
unwrapping expression?
qualifiers on a typeThe text was updated successfully, but these errors were encountered: