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
In 1-basics: "The () type is the empty type, nada, void, zilch, nothing. Everything in Rust has a value, but sometimes it's just nothing." The type () actually is a type with a single value, (). It is usually referred to as the "unit type", since it is inhabited by just the one value. The empty type, the type inhabited by no values, is !.
This is important, because the unit value is useful in programs:
match v {Some(v) => println!("{}", v),None => (),}
The text was updated successfully, but these errors were encountered:
In 1-basics: "The () type is the empty type, nada, void, zilch, nothing. Everything in Rust has a value, but sometimes it's just nothing." The type
()
actually is a type with a single value,()
. It is usually referred to as the "unit type", since it is inhabited by just the one value. The empty type, the type inhabited by no values, is!
.This is important, because the unit value is useful in programs:
The text was updated successfully, but these errors were encountered: