Skip to content

Instantly share code, notes, and snippets.

View Nivirx's full-sized avatar

Elaina Claus Nivirx

View GitHub Profile
@Nivirx
Nivirx / closure_from_closure.rs
Created November 1, 2018 05:01
A rust closure that returns a closure
fn main() {
let cfn1 = |x: i32, y: i32| x + y;
let cfn2 = || cfn1;
println!("{}", cfn2()(1, 2));
}

Keybase proof

I hereby claim:

  • I am xinnx on github.
  • I am nivirx (https://keybase.io/nivirx) on keybase.
  • I have a public key ASD6k1s6uURUH5nH9ovQZP5OpcUjgQhUumRsoG5OuFGgEwo

To claim this, I am signing this object: