# HG changeset patch # User Yuya Nishihara # Date 2018-10-07 11:55:51 # Node ID af52181f71ffc0f2a3ab80b3bbfca59e326c40e0 # Parent 96164fb9b9130bc2148fc454cf4c6eed0797c001 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. diff --git a/rust/chg/src/main.rs b/rust/chg/src/main.rs --- a/rust/chg/src/main.rs +++ b/rust/chg/src/main.rs @@ -20,7 +20,7 @@ use tokio_hglib::UnixClient; 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);