#![forbid(unsafe_code)]
fn benchmark_and_example_fixture(result: Result<u32, &'static str>, value: Option<u32>) {
let _ = result.unwrap();
let _ = value.expect("benchmarks and examples should avoid expect");
let _ = result.unwrap_or(0);
}
fn criterion_closure_fixture(result: Result<u32, &'static str>) {
let bench_body = || {
result.expect("criterion setup should surface typed errors")
};
let _ = bench_body;
}
fn result_returning_example_fixture(result: Result<u32, &'static str>) -> Result<(), &'static str> {
let _ = result.unwrap();
Ok(())
}
fn explicit_error_handling_fixture(result: Result<u32, &'static str>) -> Result<u32, &'static str> {
let value = result?;
Ok(value)
}