Return a value
(x: i32, y: i32)
| 106 | |
| 107 | // Return a value |
| 108 | fn get_sum_2(x: i32, y: i32) -> i32 { |
| 109 | // This expression is returned |
| 110 | // If you used a semicolon you'd get an error because |
| 111 | // a statement don't evaluate to a value |
| 112 | x + y |
| 113 | } |
| 114 | |
| 115 | // You can also use return |
| 116 | fn get_sum_3(x: i32, y: i32) -> i32 { |
nothing calls this directly
no outgoing calls
no test coverage detected