Skip to content

Commit e6710ae

Browse files
authored
.sync/rust_config/rustfmt.toml: Add struct and enum alignment (#389)
Add arguments to rustfmt for vertically aligning struct and enum members. Usage requires `+nightly`. Value of 8 matches 'align_var_struct_span' from uncrustify.cfg.
1 parent 21da0ab commit e6710ae

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.sync/rust_config/rustfmt.toml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@
55

66
# Keep these options sorted in ascending order to ease lookup with rustfmt documentation.
77

8-
edition = "2021" # This would normally be picked up from Cargo.toml if not specified here
9-
force_explicit_abi = true # Always print the ABI for extern items (e.g. extern {... will become extern "C" {...)
10-
hard_tabs = false # Always uses spaces for indentation and alignment
11-
max_width = 120 # The maximum width of each line
12-
merge_derives = false # Do not merge derives into a single line (leave to author discretion).
13-
imports_granularity = "Crate" # Merge imports from a single crate into separate statements.
14-
newline_style = "Windows" # Always use Windows line endings '\r\n'
15-
reorder_impl_items = false # Do not force where type and const before macros and methods in impl blocks.
16-
reorder_imports = true # Do reorder import and extern crate statements alphabetically for readability.
17-
reorder_modules = true # Do reorder mod declarations alphabetically for readability.
18-
tab_spaces = 4 # Use 4 spaces for indentation (Rust default).
19-
unstable_features = false # Do not use unstable rustfmt features.
20-
use_small_heuristics = "Max" # Set all granular width settings to the same as max_width (do not use heuristics)
21-
wrap_comments = false # Leave comment formatting to author's discretion
8+
edition = "2021" # This would normally be picked up from Cargo.toml if not specified here
9+
enum_discrim_align_threshold = 8 # Vertically align enum discriminants
10+
force_explicit_abi = true # Always print the ABI for extern items (e.g. extern {... will become extern "C" {...)
11+
hard_tabs = false # Always uses spaces for indentation and alignment
12+
max_width = 120 # The maximum width of each line
13+
merge_derives = false # Do not merge derives into a single line (leave to author discretion).
14+
imports_granularity = "Crate" # Merge imports from a single crate into separate statements.
15+
newline_style = "Windows" # Always use Windows line endings '\r\n'
16+
reorder_impl_items = false # Do not force where type and const before macros and methods in impl blocks.
17+
reorder_imports = true # Do reorder import and extern crate statements alphabetically for readability.
18+
reorder_modules = true # Do reorder mod declarations alphabetically for readability.
19+
struct_field_align_threshold = 8 # Vertically align struct fields
20+
tab_spaces = 4 # Use 4 spaces for indentation (Rust default).
21+
unstable_features = false # Do not use unstable rustfmt features.
22+
use_small_heuristics = "Max" # Set all granular width settings to the same as max_width (do not use heuristics)
23+
wrap_comments = false # Leave comment formatting to author's discretion

0 commit comments

Comments
 (0)