MCPcopy Create free account
hub / github.com/hashintel/hash / capture_ok

Function capture_ok

libs/error-stack/tests/common.rs:180–182  ·  view source on GitHub ↗
(closure: impl FnOnce() -> Result<(), Report<E>>)

Source from the content-addressed store, hash-verified

178}
179
180pub fn capture_ok<E>(closure: impl FnOnce() -> Result<(), Report<E>>) {
181 closure().expect("expected an OK value, found an error");
182}
183
184pub fn capture_error<E>(closure: impl FnOnce() -> Result<(), Report<E>>) -> Report<E> {
185 closure().expect_err("expected an error")

Callers 1

ensureFunction · 0.85

Calls 1

expectMethod · 0.45

Tested by

no test coverage detected