diff rust/chg/src/procutil.rs @ 45620:426294d06ddc

rust: move rustfmt.toml to repo root so it can be used by `hg fix` `hg fix` runs the formatters from the repo root so it doesn't pick up the `rustfmt.toml` configs we had in each the `hg-core`, `hg-cpython`, and `rhg` packages, which resulted in warnings about `async fn` not existing in Rust 2015. This patch moves the `rustfmt.toml` file to the root so `hg fix` will use it. By putting the `rustfmt.toml` file in a higher-level directory, it also applies to the `chg` and `hgcli` packages. That makes `test-check-rust-format.t` fail, so this patch also applies the new formatting rules to those packages. Differential Revision: https://phab.mercurial-scm.org/D9142
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 01 Oct 2020 09:09:35 -0700
parents 065048e66f32
children
line wrap: on
line diff
--- a/rust/chg/src/procutil.rs	Wed Sep 30 18:07:21 2020 +0530
+++ b/rust/chg/src/procutil.rs	Thu Oct 01 09:09:35 2020 -0700
@@ -44,7 +44,8 @@
     if flags < 0 {
         return Err(io::Error::last_os_error());
     }
-    let r = unsafe { libc::fcntl(fd, libc::F_SETFL, flags & !libc::O_NONBLOCK) };
+    let r =
+        unsafe { libc::fcntl(fd, libc::F_SETFL, flags & !libc::O_NONBLOCK) };
     if r < 0 {
         return Err(io::Error::last_os_error());
     }
@@ -69,7 +70,10 @@
 ///
 /// This touches global states, and thus synchronized as a one-time
 /// initialization function.
-pub fn setup_signal_handler_once(pid: u32, pgid: Option<u32>) -> io::Result<()> {
+pub fn setup_signal_handler_once(
+    pid: u32,
+    pgid: Option<u32>,
+) -> io::Result<()> {
     let pid_signed = pid as i32;
     let pgid_signed = pgid.map(|n| n as i32).unwrap_or(0);
     let mut r = 0;