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.
--- a/rust/hg-core/src/config/config_items.rs Wed Aug 09 15:44:56 2023 +0200
+++ b/rust/hg-core/src/config/config_items.rs Wed Aug 09 15:46:35 2023 +0200
@@ -198,7 +198,7 @@
_ => Err(err),
}
}
- None => Ok(Some(false)),
+ None => Ok(None),
}
}
}
--- a/rust/hg-core/src/config/mod.rs Wed Aug 09 15:44:56 2023 +0200
+++ b/rust/hg-core/src/config/mod.rs Wed Aug 09 15:46:35 2023 +0200
@@ -805,7 +805,6 @@
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());
+ assert!(ret.unwrap().is_none());
}
}