MCPcopy Create free account
hub / github.com/derekbanas/Rust-Tutorial / get_sum_2

Function get_sum_2

main.rs:108–113  ·  view source on GitHub ↗

Return a value

(x: i32, y: i32)

Source from the content-addressed store, hash-verified

106
107// Return a value
108fn 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
116fn get_sum_3(x: i32, y: i32) -> i32 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected