Skip to content

Commit 9f0311b

Browse files
committed
style: rustfmt changes
1 parent 06e5ee1 commit 9f0311b

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

.rustfmt.toml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,30 @@ 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
36+
merge_derives = false # allow multiple #[derive(..)] chunks
3937

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

xtask/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ fn main() -> Result<(), Box<dyn Error>> {
8686
Ok(n) =>
8787
if n <= MAX_PRIME_TILL {
8888
n
89-
}
90-
else {
89+
} else {
9190
eprintln!("Primes not listed. {}'s max value ({}) will take a long time for us to calculate with the current method.",
9291
t_deets.name.green(),
9392
t_deets.max.blue(),);

0 commit comments

Comments
 (0)