powered by
Test whether Result Enum is Ok or an Err.
is.err(x)
object to be tested
TRUE if x is enumerated type of variant Err, FALSE otherwise
TRUE
x
Err
FALSE
# NOT RUN { sqrt_big <- function(x) { if (x > 1000){ return(Ok(sqrt(x))) } Err("Not large enough!") } x <- sqrt_big(250) is.err(x) # TRUE # }
Run the code above in your browser using DataLab