mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 18:02:56 +00:00
remove env_config::Bool
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user