mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-29 01:29:00 +00:00
tmp
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
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,5 +1,6 @@
|
||||
pub mod crypto;
|
||||
pub mod ellipses;
|
||||
pub mod bool_flag;
|
||||
pub mod fs;
|
||||
pub mod hash;
|
||||
pub mod net;
|
||||
|
||||
Reference in New Issue
Block a user