//@ For example, consider `sqr`:
fn sqr(i: i32) -> i32 { i * i }
//@ Between the curly braces, we are giving the *expression* that computes the return value.
//@ For example, consider `sqr`:
fn sqr(i: i32) -> i32 { i * i }
//@ Between the curly braces, we are giving the *expression* that computes the return value.
fn vec_min(v: Vec<i32>) -> NumberOrNothing {
//@ Remember that helper function `min_i32`? Rust allows us to define such helper functions *inside* other
//@ functions. This is just a matter of namespacing, the inner function has no access to the data of the outer
fn vec_min(v: Vec<i32>) -> NumberOrNothing {
//@ Remember that helper function `min_i32`? Rust allows us to define such helper functions *inside* other
//@ functions. This is just a matter of namespacing, the inner function has no access to the data of the outer
fn min_i32(a: i32, b: i32) -> i32 {
if a < b { a } else { b } /*@*/
}
fn min_i32(a: i32, b: i32) -> i32 {
if a < b { a } else { b } /*@*/
}
// You will have to replace `part00` by `part01` in the `main` function in
// `main.rs` to run this code.
// You will have to replace `part00` by `part01` in the `main` function in
// `main.rs` to run this code.