📜  rust currying,预设一些参数 - Rust 代码示例

📅  最后修改于: 2022-03-11 14:49:24.945000             🧑  作者: Mango

代码示例1
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));
}