Mercurial > public > mercurial-scm > hg-stable
diff rust/chg/src/main.rs @ 40286:af52181f71ff
rust-chg: suppress panic while writing chg error to stderr
Otherwise "chg >/dev/full 2>&1" would exit with 101. Spotted by test-basic.t.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 07 Oct 2018 20:55:51 +0900 |
parents | 89742f1fa6cb |
children | 87c76e5f3427 |
line wrap: on
line diff
--- a/rust/chg/src/main.rs Sun Oct 14 04:37:25 2018 -0400 +++ b/rust/chg/src/main.rs Sun Oct 07 20:55:51 2018 +0900 @@ -20,7 +20,7 @@ fn main() { let code = run().unwrap_or_else(|err| { - eprintln!("chg: abort: {}", err); + writeln!(io::stderr(), "chg: abort: {}", err).unwrap_or(()); 255 }); process::exit(code);