Skip to main content

ok

Function ok 

Source
pub fn ok<InnerMatcherT>(inner: InnerMatcherT) -> OkMatcher<InnerMatcherT>
Expand description

Matches a Result containing Ok with a value matched by inner.

verify_that!(Ok::<_, ()>("Some value"), ok(eq("Some value")))?;  // Passes
verify_that!(Err::<&str, _>("An error"), ok(eq("An error")))?;   // Fails
verify_that!(Ok::<_, ()>("Some value"), ok(eq("Some other value")))?;   // Fails