aboutsummaryrefslogtreecommitdiff
path: root/.rustfmt.toml
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2021-01-06 22:05:33 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-01-06 22:05:33 +0000
commitedabc1003f5edda8ceb99e8e5a588da2a484b187 (patch)
treeb4a59a0bf295d7cc3837dd372b5068cb95023fc6 /.rustfmt.toml
parentdbbdfe90ffadbab9bd0cac9fb0066f527c2c7255 (diff)
parent803535edf46cf1e4d0b092b6b2e52ae776b41711 (diff)
downloadpin-project-edabc1003f5edda8ceb99e8e5a588da2a484b187.tar.gz
Upgrade rust/crates/pin-project to 1.0.3 am: 803535edf4
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pin-project/+/1541052 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ie8d6095b157cc4e978815ebf56f0511793973753
Diffstat (limited to '.rustfmt.toml')
-rw-r--r--.rustfmt.toml34
1 files changed, 34 insertions, 0 deletions
diff --git a/.rustfmt.toml b/.rustfmt.toml
new file mode 100644
index 0000000..6604f5c
--- /dev/null
+++ b/.rustfmt.toml
@@ -0,0 +1,34 @@
+# Rustfmt configuration
+# https://github.com/rust-lang/rustfmt/blob/HEAD/Configurations.md
+
+# This is required for bug-fixes, which technically can't be made to the stable
+# first version.
+# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3383).
+version = "Two"
+# Rustfmt cannot format long lines inside macros, but this option detects this.
+# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3391)
+error_on_line_overflow = true
+
+# Override the default formatting style.
+# See https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81.
+use_small_heuristics = "Max"
+# See https://github.com/rust-dev-tools/fmt-rfcs/issues/149.
+# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3370)
+overflow_delimited_expr = true
+
+# Apply rustfmt to more places.
+# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3362).
+merge_imports = true
+# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3348).
+format_code_in_doc_comments = true
+
+# Automatically fix deprecated style.
+use_field_init_shorthand = true
+use_try_shorthand = true
+
+# Set the default settings again to always apply the proper formatting without
+# being affected by the editor settings.
+edition = "2018"
+hard_tabs = false
+newline_style = "Unix"
+tab_spaces = 4