External Publication
Visit Post

Add an implementation for the Default trait for std::ops::ControlFlow

Rust Internals [Unofficial] April 22, 2026
Source
I think it would make a lot of sense for ControlFlow to implement Default when T: Default, with the value returned being Continue(T::default()). This is a small addition that can be useful in certain contexts. Choosing Continue as the default variant seems obvious to me, but if anyone feels different perhaps this could be confusing and should be disregarded. I would like to hear your opinion.

Discussion in the ATmosphere

Loading comments...