function
unwrap_or
unwrap_or(o: option, fallback) -> int
Reads an option: returns its value when it is some, or fallback when it is none. The safe, one-line way to get a usable value out of an option without a separate branch.
Parameters
othe option to readfallbackthe value to use when the option is emptyExample
program Config {
handler Step phase Update {
let volume = unwrap_or(none(), 100) # default to 100
}
}