use snafu::prelude::*; #[derive(Debug, Snafu)] enum Error { Mine, } type Result = std::result::Result; fn other_result() -> Result { Err(()) } fn map_result() -> Result { other_result().map_err(|_| MineSnafu.build()) } #[test] fn implements_error() { fn check() {} check::(); map_result().unwrap_err(); }