Function isError [src]
Returns whether error_union contains an error.
Prototype
pub fn isError(error_union: anytype) bool
Example
test isError {
try std.testing.expect(isError(math.divTrunc(u8, 5, 0)));
try std.testing.expect(!isError(math.divTrunc(u8, 5, 5)));
}
Source
pub fn isError(error_union: anytype) bool {
return if (error_union) |_| false else |_| true;
}