fn call_with_fn(f: F) where F: Fn(), { f(); f(); } let text = String::from("hello"); let print_text = || println!("{}", text); call_with_fn(print_text);