Mercurial > hg
comparison rust/hg-core/src/config/config_items.rs @ 50983:8343947af6a7
rust-config: fix incorrect coercion of null values to false
As explained in the previous changeset:
Probably being too trigger happy about boolean values, I incorrectly set
the transform for a `None` to a `Some(false)`. It would cause for example
the `ui.formatted` value to be set to `Some(false)`, which turns off the colors
among other things, when `None` would trigger the automatic behavior.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 09 Aug 2023 15:46:35 +0200 |
parents | 58390f59826f |
children |
comparison
equal
deleted
inserted
replaced
50982:10e57e3f7276 | 50983:8343947af6a7 |
---|---|
196 toml::Value::Boolean(b), | 196 toml::Value::Boolean(b), |
197 ) => Ok(Some(*b)), | 197 ) => Ok(Some(*b)), |
198 _ => Err(err), | 198 _ => Err(err), |
199 } | 199 } |
200 } | 200 } |
201 None => Ok(Some(false)), | 201 None => Ok(None), |
202 } | 202 } |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 impl TryFrom<&DefaultConfigItem> for Option<u32> { | 206 impl TryFrom<&DefaultConfigItem> for Option<u32> { |