I don't know much about rust, but I am just curious why the last line doesn't have a "return" keyword? Does it just assume the last line is the value to return? Could you include the "return" keyword if you wanted?
If there is no `;` then the last statement is considered the return value. You can include the return if you want but then you also need the `;` at the end.
8
u/Depnids 1d ago
I don't know much about rust, but I am just curious why the last line doesn't have a "return" keyword? Does it just assume the last line is the value to return? Could you include the "return" keyword if you wanted?