Skip to main content

get_bool

Function get_bool 

Source
pub fn get_bool(key: &str, fallback: bool) -> bool
Expand description

Safely parse boolean variables. Recognizes “true”, “1”, “yes”, “on” as true, and “false”, “0”, “no”, “off” as false. If the variable is unset or unrecognized, returns the fallback value.

§Examples

use rskit_util::env::get_bool;
let is_enabled = get_bool("FEATURE_FLAG", false);