Skip to content

Commit bce3032

Browse files
authored
Update functions5.rs
1 parent a6bb340 commit bce3032

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions/functions5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn square(num: i32) -> i32 {
4040

4141
// This is a really common error that can be fixed by removing one character.
4242
// It happens because Rust distinguishes between expressions and statements: expressions return
43-
// a value based on its operand and statements simply retun a `()` type which just like `void` in C/C++ language.
43+
// a value based on its operand, and statements simply retun a () type which behaves just like `void` in C/C++ language.
4444
// We want to return a value of `i32` type from the `square` function, but it is returning a `()` type...
4545
// They are not the same. There are two solusions:
4646
// 1. Add a `return` ahead of `num * num;`

0 commit comments

Comments
 (0)