remove env_config::Bool

This commit is contained in:
Christian Schwarz
2024-04-05 17:17:35 +02:00
parent 3779854f12
commit 5cf45df692

View File

@@ -35,32 +35,3 @@ where
}
}
}
pub struct Bool(bool);
impl Bool {
pub const fn new(v: bool) -> Self {
Bool(v)
}
}
impl FromStr for Bool {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
if let Ok(b) = s.parse() {
return Ok(Bool(b));
}
Ok(Bool(match s {
"0" => false,
"1" => true,
_ => return Err(format!("not a bool, accepting 0|1|{}|{}", false, true)),
}))
}
}
impl From<Bool> for bool {
fn from(val: Bool) -> Self {
val.0
}
}