Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. struct World { x: usize }
  2.  
  3. fn a (callback: fn (world: &World) -> ()) {
  4. callback(&World { x: 0 })
  5. }
  6.  
  7. fn main () {
  8. a(|w| {
  9. assert!(w.x == 0)
  10. })
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement