diff rust/hgcli/src/main.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 26ce8e751503
children
line wrap: on
line diff
--- a/rust/hgcli/src/main.rs	Wed Sep 30 18:07:21 2020 +0530
+++ b/rust/hgcli/src/main.rs	Thu Oct 01 09:09:35 2020 -0700
@@ -9,21 +9,22 @@
 include!(env!("PYOXIDIZER_DEFAULT_PYTHON_CONFIG_RS"));
 
 fn main() {
-    // The following code is in a block so the MainPythonInterpreter is destroyed in an
-    // orderly manner, before process exit.
+    // The following code is in a block so the MainPythonInterpreter is
+    // destroyed in an orderly manner, before process exit.
     let code = {
-        // Load the default Python configuration as derived by the PyOxidizer config
-        // file used at build time.
+        // Load the default Python configuration as derived by the PyOxidizer
+        // config file used at build time.
         let config = default_python_config();
 
-        // Construct a new Python interpreter using that config, handling any errors
-        // from construction.
+        // Construct a new Python interpreter using that config, handling any
+        // errors from construction.
         match MainPythonInterpreter::new(config) {
             Ok(mut interp) => {
-                // And run it using the default run configuration as specified by the
-                // configuration. If an uncaught Python exception is raised, handle it.
-                // This includes the special SystemExit, which is a request to terminate the
-                // process.
+                // And run it using the default run configuration as specified
+                // by the configuration. If an uncaught Python
+                // exception is raised, handle it.
+                // This includes the special SystemExit, which is a request to
+                // terminate the process.
                 interp.run_as_main()
             }
             Err(msg) => {