about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.rustfmt.toml22
-rw-r--r--rustfmt.toml1
-rw-r--r--tools/depotfmt.nix7
3 files changed, 8 insertions, 22 deletions
diff --git a/.rustfmt.toml b/.rustfmt.toml
deleted file mode 100644
index 6ad0d5341a..0000000000
--- a/.rustfmt.toml
+++ /dev/null
@@ -1,22 +0,0 @@
-# This configuration file changes some defaults from the ones
-# documented on https://rust-lang.github.io/rustfmt/
-#
-# All other settings are left at the defaults.
-
-edition = "2018"
-newline_style = "Unix"
-use_try_shorthand = true
-
-# Unstable settings that we want in the future, once they are
-# available:
-#
-# combine_control_expr = false
-# comment_width = 100
-# condense_wildcard_suffixes = true
-# format_code_in_doc_comments = true
-# inline_attribute_width = 100
-# match_block_trailing_comma = true
-# merge_imports = true
-# normalize_comments = true
-# overflow_delimited_expr = true
-# wrap_comments = true
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 0000000000..3a26366d4d
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1 @@
+edition = "2021"
diff --git a/tools/depotfmt.nix b/tools/depotfmt.nix
index 21e71bf3b6..dbd3a31a0d 100644
--- a/tools/depotfmt.nix
+++ b/tools/depotfmt.nix
@@ -26,6 +26,13 @@ let
       "third_party/nix/tests/*",
       "third_party/nix/src/tests/*"
     ]
+
+    [formatter.rust]
+    command = "${pkgs.rustfmt}/bin/rustfmt"
+    includes = [ "*.rs" ]
+    excludes = [
+      "users/tazjin/*",
+    ]
   '';
 
   # helper tool for formatting the depot interactively