galvanic_assert::matchers::variant

Function maybe_some

Source
pub fn maybe_some<'a, T: 'a>(
    matcher: Box<dyn Matcher<'a, T> + 'a>,
) -> Box<dyn Matcher<'a, Option<T>> + 'a>
Expand description

Matches the contents of an Option againts a passed Matcher.

#Examples

use galvanic_assert::matchers::*;
use galvanic_assert::matchers::variant::*;
assert_that!(&Some(32), maybe_some(eq(32)));