mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 15:16:56 +00:00
@@ -2,14 +2,8 @@ use crate::error::{Error, Result};
|
||||
|
||||
pub fn parse_bool(str: &str) -> Result<bool> {
|
||||
match str {
|
||||
"1" | "t" | "T" | "true" | "TRUE" | "True" | "on" | "ON" | "On" | "enabled" => {
|
||||
return Ok(true);
|
||||
}
|
||||
"0" | "f" | "F" | "false" | "FALSE" | "False" | "off" | "OFF" | "Off" | "disabled" => {
|
||||
return Ok(false);
|
||||
}
|
||||
_ => {
|
||||
return Err(Error::from_string(format!("ParseBool: parsing {}", str)));
|
||||
}
|
||||
"1" | "t" | "T" | "true" | "TRUE" | "True" | "on" | "ON" | "On" | "enabled" => Ok(true),
|
||||
"0" | "f" | "F" | "false" | "FALSE" | "False" | "off" | "OFF" | "Off" | "disabled" => Ok(false),
|
||||
_ => Err(Error::from_string(format!("ParseBool: parsing {}", str))),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user