treat any query parameter value as true in bool params
This commit is contained in:
parent
e83fac75aa
commit
672cdd93df
|
@ -111,11 +111,7 @@ fn deserialize_bool_param<'de, D>(deserializer: D) -> Result<bool, D::Error>
|
||||||
where
|
where
|
||||||
D: Deserializer<'de>,
|
D: Deserializer<'de>,
|
||||||
{
|
{
|
||||||
let opt = Option::<String>::deserialize(deserializer)?;
|
Ok(Option::<&str>::deserialize(deserializer)?.is_some())
|
||||||
match opt.as_deref() {
|
|
||||||
Some("1") | Some("true") | Some("") => Ok(true),
|
|
||||||
_ => Ok(false),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<&UserLogsPath> for UserLogDate {
|
impl TryFrom<&UserLogsPath> for UserLogDate {
|
||||||
|
|
Loading…
Reference in New Issue