//@ So we can just write `i * i`, the expression that returns the square if `i`!
//@ This is very close to how mathematicians write down functions (but with more types).
//@ So we can just write `i * i`, the expression that returns the square if `i`!
//@ This is very close to how mathematicians write down functions (but with more types).
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.