D1581: [RFC] rust: Rust implementation of `hg` and standalone packaging
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Mon Dec 4 17:28:31 EST 2017
durin42 added inline comments.
INLINE COMMENTS
> main.rs:130
> +
> +fn main() {
> + let env = get_environment();
You might be able to usefully avoid all the unwrap() in here by having an extra layer, eg
fn run() -> Result<(), failure::Error> {
...
let program_name = CString::new(env.python_exe.to_str()?)?.as_ptr();
}
and then
fn main() {
let mut exit_code;
match run() {
Ok(_) => exit_code = 0,
Err(e) => { println!("{:?}", e); exit_code = 1; },
}
std::process::exit(exit_code);
}
etc
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1581
To: indygreg, #hg-reviewers
Cc: durin42, dlax, mercurial-devel
More information about the Mercurial-devel
mailing list