treat any query parameter value as true in bool params

This commit is contained in:
boring_nick 2023-06-27 16:10:09 +03:00
parent e83fac75aa
commit 672cdd93df
1 changed files with 1 additions and 5 deletions

View File

@ -111,11 +111,7 @@ fn deserialize_bool_param<'de, D>(deserializer: D) -> Result<bool, D::Error>
where
D: Deserializer<'de>,
{
let opt = Option::<String>::deserialize(deserializer)?;
match opt.as_deref() {
Some("1") | Some("true") | Some("") => Ok(true),
_ => Ok(false),
}
Ok(Option::<&str>::deserialize(deserializer)?.is_some())
}
impl TryFrom<&UserLogsPath> for UserLogDate {