rust-config: show default `null` is coerced incorrectly to `false`
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 09 Aug 2023 15:44:56 +0200
changeset 50982 10e57e3f7276
parent 50981 58390f59826f
child 50983 8343947af6a7
rust-config: show default `null` is coerced incorrectly to `false` 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. This is fixed in the next commit.
rust/hg-core/src/config/mod.rs
--- a/rust/hg-core/src/config/mod.rs	Wed Aug 09 15:41:18 2023 +0200
+++ b/rust/hg-core/src/config/mod.rs	Wed Aug 09 15:44:56 2023 +0200
@@ -803,5 +803,9 @@
             .expect("expected valid config");
         let ret = config.get_byte_size(b"cmdserver", b"max-log-size");
         assert!(ret.is_ok(), "{:?}", ret);
+
+        let ret = config.get_byte_size(b"ui", b"formatted");
+        // FIXME should be `is_none()`
+        assert!(ret.unwrap().is_some());
     }
 }