Mercurial > hg
diff rust/chg/src/uihandler.rs @ 43818:ce088b38f92b
rust: run rustfmt
# skip-blame automated reformatting
Differential Revision: https://phab.mercurial-scm.org/D7578
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 07 Dec 2019 13:06:25 -0800 |
parents | e70b616a077b |
children | 6bef9d43cc55 |
line wrap: on
line diff
--- a/rust/chg/src/uihandler.rs Fri Dec 06 16:09:03 2019 -0500 +++ b/rust/chg/src/uihandler.rs Sat Dec 07 13:06:25 2019 -0800 @@ -3,8 +3,8 @@ // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. +use futures::future::IntoFuture; use futures::Future; -use futures::future::IntoFuture; use std::io; use std::os::unix::io::AsRawFd; use std::os::unix::process::ExitStatusExt; @@ -33,8 +33,7 @@ } /// Default cHg implementation to process requests received from server. -pub struct ChgUiHandler { -} +pub struct ChgUiHandler {} impl ChgUiHandler { pub fn new() -> ChgUiHandler { @@ -57,7 +56,7 @@ // otherwise the server won't get SIGPIPE if it does not write // anything. (issue5278) // kill(peerpid, SIGPIPE); - tokio::spawn(pager.map(|_| ()).map_err(|_| ())); // just ignore errors + tokio::spawn(pager.map(|_| ()).map_err(|_| ())); // just ignore errors Ok((self, pin)) } @@ -67,7 +66,9 @@ .into_future() .flatten() .map(|status| { - let code = status.code().or_else(|| status.signal().map(|n| -n)) + let code = status + .code() + .or_else(|| status.signal().map(|n| -n)) .expect("either exit code or signal should be set"); (self, code) }); @@ -84,4 +85,4 @@ .env_clear() .envs(spec.envs.iter().cloned()); builder - } +}