Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustclosures Fn FnMut FnOnceSingle-choice MCQ

What is the key reason this signature is often preferred over `fn apply(f: impl Fn(i32) -> i32)` when the function only ever calls f once and wants maximum caller flexibility?

fn apply<F: FnOnce(i32) -> i32>(f: F) -> i32 { f(7) }