Skip to content

Commit eac5d69

Browse files
committed
proposed rustfmt.toml
1 parent 03dfec6 commit eac5d69

File tree

2 files changed

+60
-6
lines changed

2 files changed

+60
-6
lines changed

.rustfmt.toml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Max width of each line
2+
max_width = 100
3+
4+
# Rust community convention: spaces (4) or tab = false for spaces
5+
use_tabs = false
6+
tab_spaces = 4
7+
8+
indent_style = "Block"
9+
10+
struct_field_align_threshold = 20
11+
12+
# Control how comments are formatted
13+
normalize_comments = true
14+
wrap_comments = true
15+
comment_width = 100
16+
17+
# Control formatting of method chains
18+
chain_split_threshold = 80
19+
indent_method_chain = true
20+
21+
# Imports formatting
22+
reorder_imports = true
23+
group_imports = "StdExternalCrate" # separate standard library from external crates
24+
merge_imports = true
25+
26+
# Control trailing commas
27+
trailing_comma = "Always"
28+
29+
# Control alignment of comments and attributes
30+
align_comments = true
31+
align_attributes = true
32+
33+
# How to format single-line vs multi-line
34+
single_argument = "Always" # put each argument on its own line if multiline
35+
match_block_trailing_comma = true
36+
37+
# Control visibility groups
38+
# (no explicit option in rustfmt to group visibilities, but keep consistent ordering manually)
39+
40+
# Control where to place attributes
41+
reorder_modules = true
42+
format_macro_args = true
43+
44+
# Use the 'visual' indent for nested indentations
45+
visual_indent_width = 4
46+
47+
# Overflow behaviour
48+
overflow_delimited_expr = "Auto"
49+
50+
# Control blank lines
51+
blank_lines_upper_bound = 1
52+
blank_lines_lower_bound = 0
53+
54+
# Use the newer rustfmt rule for where to put braces
55+
brace_style = "AlwaysNextLineWhereRequired"
56+
57+
# Preserve width of chained method calls
58+
wrap_chained_methods = true

src/service.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,8 @@ impl Service {
201201
FrontendRequest::ResolveDns(handle) => self.resolve(handle),
202202
FrontendRequest::Sync => self.sync_frontend(),
203203
FrontendRequest::RemoveAuthorizedKey(key) => self.remove_authorized_key(key),
204-
FrontendRequest::UpdateEnterHook(handle, enter_hook) => {
205-
self.update_enter_hook(handle, enter_hook)
206-
}
207-
FrontendRequest::UpdateScrollingInversion(invert_scroll) => {
208-
self.update_scrolling_inversion(invert_scroll)
209-
}
204+
FrontendRequest::UpdateEnterHook(handle, enter_hook) => self.update_enter_hook(handle, enter_hook),
205+
FrontendRequest::UpdateScrollingInversion(invert_scroll) => self.update_scrolling_inversion(invert_scroll),
210206
FrontendRequest::UpdateMouseSensitivity(mouse_sensitivity) => self.update_mouse_sensitivity(mouse_sensitivity),
211207
}
212208
}

0 commit comments

Comments
 (0)