> "We expected an integer, but we got (). () is pronounced 'unit', and is a special type in Rust's type system. () is different than null in other languages, because () is distinct from other types"
Would it not be more accurate and more informative to compare the "special type" unit to "void" than to compare it to "null" ?
The keyword "void" is a placeholder that says "nothing here" where normally there would be a type. It function more or less like a type. i.e. "public void foo { ... };" instead of "public int foo() { ... };"
I understand "unit" as a "first class void".
"null" on the other hand is a value, that can be placed in variables of many types.