Guest User

Untitled

a guest
Dec 6th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. fn invoke<F, R>(f: F) -> R
  2. where
  3. F: Fn(i32) -> R,
  4. {
  5. f(1)
  6. }
  7.  
  8. fn main() {
  9. let inc: i32 = invoke(|v| v + 1);
  10. let toa: String = invoke(|v| format!("{}", v));
  11. }
Add Comment
Please, Sign In to add comment