`std::result::Result` has experimental `is_some_with` and `is_err_and` methods, and we could consider equivalents here.