Skip to content

Commit 7f3c3ce

Browse files
committed
style: rustfmt changes
1 parent c53dd4e commit 7f3c3ce

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

.rustfmt.toml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,29 @@ ignore = [] # files for rustfmt to ignore
1414
# required_version # specify rustfmt version requirement
1515

1616
## --- regular-config ---
17+
imports_indent = "Visual"
18+
indent_style = "Visual" # nests inline with thing needing verticality
19+
1720
brace_style = "PreferSameLine" # braces start on line of what they connect to
1821
chain_width = 30 # default: 60
19-
control_brace_style = "ClosingNextLine" # e.g. if & else in line with eachother
22+
23+
struct_field_align_threshold = 20 # move distance to seek type alignment in struct fields
24+
enum_discrim_align_threshold = 20 # move distance to seek type alignment in enum discriminants
2025

2126
match_arm_blocks = false # only use {} if multiple statements (vs multline single statements)
22-
format_macro_bodies = false
2327
match_block_trailing_comma = true # commas between all match arms ({},)
2428

2529
imports_granularity = "Crate" # group all imports for a crate together
26-
overflow_delimited_expr = true # no double nesting for verticle formatted lists, etc.
27-
reorder_impl_items = true # assoc_type & const at top of impl
28-
2930
group_imports = "StdExternalCrate" # category style grouping of imports (ala isort in python)
30-
struct_field_align_threshold = 20 # move distance to seek type alignment in struct fields
31-
enum_discrim_align_threshold = 20 # move distance to seek type alignment in enum discriminants
32-
33-
use_field_init_shorthand = true # let _ = some_struct {x, y, z}
34-
where_single_line = true # where on single line if few types
3531

36-
imports_indent = "Visual"
37-
indent_style = "Visual" # nests inline with thing needing verticality
32+
format_macro_bodies = false
33+
format_code_in_doc_comments = true
3834

35+
reorder_impl_items = true # assoc_type & const at top of impl
3936

4037
## --- previously debated options ---
4138
# tab_spaces = 8 # legible groups! (~; and is a lot when combiend iwth "Visual" styles)
4239
# format_strings = true # auto line-break strings (easier to read, more annoying to edit)
4340
# trailing_semicolon = false # no `;` after continue/break/return (allows, but doesn't enforce no trailing `;)
4441
# inline_attribute_width=50 # distance to allow attributes on same lines a what they tag (visually surprising)
42+
# use_field_init_shorthand = true # let _ = some_struct {x, y, z}

0 commit comments

Comments
 (0)