We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d4ab3f2 + 5045db7 commit af8550fCopy full SHA for af8550f
functions/functions5.rs
@@ -42,6 +42,6 @@ fn square(num: i32) -> i32 {
42
// It happens because Rust distinguishes between expressions and statements: expressions return
43
// a value based on its operand, and statements simply return a () type which behaves just like `void` in C/C++ language.
44
// We want to return a value of `i32` type from the `square` function, but it is returning a `()` type...
45
-// They are not the same. There are two solusions:
+// They are not the same. There are two solutions:
46
// 1. Add a `return` ahead of `num * num;`
47
// 2. remove `;`, make it to be `num * num`
0 commit comments