Learn R Programming

matchr (version 0.1.0)

into_option: Convert Object into Option

Description

Create an Option out of an object. By default the object is wrapped in a Some variant. Ok variants of Result are turned into Some Options, while Err variants are turned into None Options.

Usage

into_option(x, ...)

Arguments

x

Object to be converted

...

Objects passed to methods

Value

an Enum object of class Option

Examples

Run this code
# NOT RUN {
an_error <- Result$Err("hello world!")
into_option(an_error) # None

# }

Run the code above in your browser using DataLab