|
|
|
|
|
by estebank
3045 days ago
|
|
Immutability by default, exhaustiveness checks (make sure that you match over all variants of an enum or cover all valid values in an integer), return flow validation (did you forget a return somewhere? Is it the right type?), and, as you mentioned, type checking being mandatory, all libraries define their accepted types. Not only that, being types "cheap", it is customary to wrap base types in explicit types that won't be compiled: type Point(u32);
fn foo(p: Point) {...}
foo(0u32);
^^^^ expected Point, found u32
|
|