aboutsummaryrefslogtreecommitdiff
path: root/.rustfmt.toml
diff options
context:
space:
mode:
Diffstat (limited to '.rustfmt.toml')
-rw-r--r--.rustfmt.toml19
1 files changed, 19 insertions, 0 deletions
diff --git a/.rustfmt.toml b/.rustfmt.toml
new file mode 100644
index 0000000..dc49733
--- /dev/null
+++ b/.rustfmt.toml
@@ -0,0 +1,19 @@
+# Rustfmt configuration
+# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md
+
+# This is required for bug-fixes, which technically can't be made to the stable
+# first version.
+version = "Two" # Tracking issue: https://github.com/rust-lang/rustfmt/issues/3383
+
+# Refs: https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/72
+use_small_heuristics = "Max"
+
+# Apply rustfmt to more places.
+merge_imports = true # Tracking issue: https://github.com/rust-lang/rustfmt/issues/3362
+format_code_in_doc_comments = true # Tracking issue: https://github.com/rust-lang/rustfmt/issues/3348
+
+# Set the default settings again to always apply the proper formatting without
+# being affected by the editor settings.
+# Refs: https://github.com/rust-lang/rls/issues/501#issuecomment-333717736
+edition = "2018"
+tab_spaces = 4