sdk: rustfmt rules for sdk

Change-Id: I43d4252facd6f0c817053e07a35bb74d874064bd
This commit is contained in:
Reisen 2021-12-08 14:25:07 +00:00 committed by Reisen
parent ee0fea0436
commit 982ce08c4a
1 changed files with 18 additions and 0 deletions

18
sdk/rust/rustfmt.toml Normal file
View File

@ -0,0 +1,18 @@
# Merge similar crates together to avoid multiple use statements.
imports_granularity = "Module"
# Consistency in formatting makes tool based searching/editing better.
empty_item_single_line = false
# Easier editing when arbitrary mixed use statements do not collapse.
imports_layout = "Vertical"
# Default rustfmt formatting of match arms with branches is awful.
match_arm_leading_pipes = "Preserve"
# Align Fields
enum_discrim_align_threshold = 80
struct_field_align_threshold = 80
# Allow up to two blank lines for grouping.
blank_lines_upper_bound = 2