rust currying, preset some arguments code example
Example: rust currying, preset some arguments
fn add(a: u32, b: u32) -> u32 {
a + b
}
fn main() {
// setting one of the parameters to a fixed value
let add5 = move |x| add(5, x);
println!("sample usage = {} ",add5(20));
}