D1581: rust: implementation of `hg`
ruuda (Ruud van Asseldonk)
phabricator at mercurial-scm.org
Thu Jan 11 12:09:47 EST 2018
ruuda added a comment.
Awesome! I have just a few things that could be written more briefly.
INLINE COMMENTS
> build.rs:39
> + let script = "import sysconfig; \
> +c = sysconfig.get_config_vars(); \
> +print('SEPARATOR STRING'.join('%s=%s' % i for i in c.items()))";
You can safely indent those, leading whitespace on the continuation line will be stripped from the string literal.
> build.rs:107
> + None => false,
> + };
> +
There is no need to match:
let result = config.config.get(*key) == Some("1");
Or using assert as @kevincox recommends:
assert_eq!(config.config.get(*key), Some("1"), "Detected ...");
> main.rs:187
> + Err(255)
> + }
> + Ok(()) => Ok(()),
There exists `Result::map_err` for this:
result = run_py(&env, py).map_err(|err| {
err.print(py);
255
});
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1581
To: indygreg, #hg-reviewers, yuja, durin42
Cc: ruuda, kevincox, cramertj, yuja, quark, durin42, dlax, mercurial-devel
More information about the Mercurial-devel
mailing list