Expand description
Safe unwrap replacements for tests.
This crate provides panic-on-failure helpers that are safe to use in tests,
avoiding explicit unwrap() calls which are denied by clippy policy.
§Overview
Three helpers cover the common cases:
must— extract the value from aResult, or panic with the errormust_some— extract the value from anOption, or panicmust_err— extract the error from aResult, or panic ifOk
§Example
use perl_test_must::{must, must_some, must_err};
let result: Result<i32, &str> = Ok(42);
assert_eq!(must(result), 42);
let opt: Option<i32> = Some(7);
assert_eq!(must_some(opt), 7);
let err_result: Result<i32, &str> = Err("oops");
assert_eq!(must_err(err_result), "oops");