Why no `Break(_)` and `Continue(_)`?

There is Ok(_) and there is Err(_) from Result.

Why are the ControlFlow variants Continue and Break not available to use anywhere like Ok and Err are?

use std::ops::ControlFlow::{
    self,
    Break,
    Continue,
};

helps

2 Likes

To answer the other direction of the question from the previous answer, the reason Ok and Err are available un-prefixed is that they're in the prelude: https://doc.rust-lang.org/std/prelude/v1/index.html#reexport.Ok

4 Likes