Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Rust
/
Closures
A function chooses at runtime between two capturing closure expressions and returns the c…
from Closures
Rust 1.98
intermediate
1 min
A function chooses at runtime between two capturing closure expressions and returns the chosen callback. Which return type directly supports this?
Box<dyn Fn(i32) -> i32>
impl Fn(i32) -> i32 with an unrelated closure in each branch
fn(i32) -> i32 for arbitrary capturing closures
&dyn Fn(i32) -> i32 borrowed from a local Box
Check
Ask AI about this kata
Report an error
next kata
Which statement about move || println!("{label}") is correct when label is a String?
Quiz
A new version is available
Reload