Skip to main content

parse_bool

Function parse_bool 

Source
pub fn parse_bool(val: &str) -> Result<bool>
Expand description

Parse a string as a boolean value, returning an error if it is neither truthy nor falsey.

ยงReturns

  • Ok(true) - for truthy values (is_truthy)
  • Ok(false) - for falsey values (is_falsey), including empty
  • Err(_) - for any other value