Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct World { x: usize }
- fn a (callback: fn (world: &World) -> ()) {
- callback(&World { x: 0 })
- }
- fn main () {
- a(|w| {
- assert!(w.x == 0)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement