SHARE
TWEET

Untitled

a guest Apr 19th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn fun_test(value: i32, f: &Fn(i32) -> i32) -> i32 {
  2.     println!("{}", f(value));
  3.     value
  4. }
  5.  
  6. fn times2(value: i32) -> i32 {
  7.     2 * value
  8. }
  9.  
  10. fn main() {
  11.     fun_test(5, &times2);
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top