#control-flow #inspect #pattern #methods

no-std controlflow_inspect

inspect_* methods for ControlFlow

1 stable release

1.0.0 Jan 2, 2025

#1603 in Rust patterns

MIT/Apache

8KB

An extension trait for ControlFlow which provides inspection methods

The naming conventions are derived from Result::inspect_err. Since ControlFlow is more symmetrical than Result, the methods are called inspect_break and inspect_continue.


controlflow_inspect

Crates.io License Crates.io Version GitHub branch check runs docs.rs Static Badge

inspect_break and inspect_continue for ControlFlow.

Overview

Analogically to inspect and inspect_err for inspecting values inside Result, this crate introduces inspect_break and inspect_continue for ControlFlow. Neither the break nor the continue variant of ControlFlow is more important than the other, so the methods are named symmetrically.

No runtime deps