1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#[cfg(test)]
#[path = "./util_test.rs"]
mod util_test;
pub(crate) const EMPTY_VALUE: &str = "<envmnt::empty>";
pub(crate) fn bool_to_string(value: bool) -> String {
if value {
"true".to_string()
} else {
"false".to_string()
}
}
pub(crate) fn string_to_bool(value: &str) -> bool {
let value_lower_case = value.to_lowercase();
return value_lower_case.len() > 0
&& value_lower_case != "false"
&& value_lower_case != "no"
&& value_lower_case != "0";
}