Simon Sapin <simon.sapin@octobus.net> [Tue, 16 Feb 2021 15:22:20 +0100] rev 46637
rust: Add a `ConfigValueParseError` variant to common errors
Configuration files are parsed into sections of key/value pairs when
they are read, but at that point values are still arbitrary bytes.
Only when a value is accessed by various parts of the code do we know
its expected type and syntax, so values are parsed at that point.
Let’s make a new error type for this latter kind of parsing error,
and add a variant to the common `HgError` so that most code can propagate it
without much boilerplate.
Differential Revision: https://phab.mercurial-scm.org/D10009
Simon Sapin <simon.sapin@octobus.net> [Tue, 16 Feb 2021 13:55:31 +0100] rev 46636
rust: Add config parsing support for more value types
* Rust `str` (ASCII or UTF-8)
* Integer
* Byte quantities
Differential Revision: https://phab.mercurial-scm.org/D10008
Simon Sapin <simon.sapin@octobus.net> [Wed, 17 Feb 2021 11:21:34 +0100] rev 46635
rust: Introduce a get_bytes_from_os_str utility function
It does the same as get_bytes_from_path but takes an `OsStr`
instead of a `Path`. The implementation is the same so using either
ends up correct but the function name suggests it’s not.
Differential Revision: https://phab.mercurial-scm.org/D10007