External Publication
Visit Post

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

Rust Internals [Unofficial] April 22, 2026
Source

steffahn:

I see ControlFlow as "like Result with without the semantic extra assumptions Result comes with"

This is absolutely 100% the intent of the type, yup.

It replaces code that was extremely confusing because it was using Err for "success" because having ? short-circuit that was helpful. This is also why while Result has map and map_err but ControlFlow has map_break and map_continue: Neither variant is "preferred" over the other.

Discussion in the ATmosphere

Loading comments...