-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Closures #1746
Copy link
Copy link
Open
Labels
A-exercisesArea: ExercisesArea: ExercisesC-new-exerciseCategory: New ExerciseCategory: New ExerciseP-mediumPriority: MediumPriority: Medium
Milestone
Metadata
Metadata
Assignees
Labels
A-exercisesArea: ExercisesArea: ExercisesC-new-exerciseCategory: New ExerciseCategory: New ExerciseP-mediumPriority: MediumPriority: Medium
Type
Fields
Give feedbackNo fields configured for issues without a type.
One topic I see new people hit pretty early on is the capturing semantics and the
Fn*traits.I was thinking of adding a few lessons to show:
movemove(including ie. binding a reference to a variable before using it in the closure and a reference is moved)Fn*traits are auto-implemented.Fn*traits for async-block-futures.I wanted to read the room a bit before actually putting time into this. Do we think this might be a bit too advanced for rustlings? Would it depend on the actual content? Would anyone be willing to help review my lessons to try and get it over the finish line?
It's an issue I get asked about constantly, especially when dealing with GUI frameworks like egui that make use of lots of nested closures... it might help people intuit these issues more clearly.
Let me know what you think!