-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrustfmt.toml
51 lines (47 loc) · 2.06 KB
/
rustfmt.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use_try_shorthand = true
use_field_init_shorthand = true
tab_spaces = 4
fn_args_layout = "Tall"
# 万一你要使用 rustfmt 2.0 就需要指定这个·
# version = "Two"
# 统一管理宽度设置,但不包含 comment_width
use_small_heuristics="MAX"
# nightly, 使多个标识符定义保持对齐风格,代码看上去可以非常工整
# indent_style="Visual"
# nightly, 设置让自定义具有判别式的枚举体按等号对齐的宽度
# enum_discrim_align_threshold = 10
# nightly, 在match分支中,如果包含了块,也需要加逗号以示分隔
# match_block_trailing_comma=true
# nightly, 自动将同一个 crate 的模块导入合并到一起
# imports_granularity="Crate"
# nightly, StdExternalCrate 导入模块分组规则
# 1. 导入来自 std、core 和 alloc 的模块需要置于前面一组。
# 2. 导入来自 第三方库的模块 应该置于中间一组。
# 3. 导入来自本地 self、super和crate前缀的模块,置于后面一组。
# group_imports="StdExternalCrate"
# nightly, format_macro_matchers 规则说明:
# 声明宏 模式匹配分支(=> 左侧)中要使用紧凑格式
# 默认声明宏分支代码体(=> 右侧) 使用宽松格式
# format_macro_matchers=true
# 当使用 extern 指定外部函数时,不需要显式指定 C-ABI ,默认就是 C-ABI
force_explicit_abi=false
# nightly, 指定一行注释允许的最大宽度
# comment_width=100
# nightly, wrap_comments 配合 comment_width 使用,自动将一行超过宽带限制的注释切分为多行注释
# wrap_comments=true
# nightly, 将 /**/ 注释转为 //
# normalize_comments=true
# nightly, 会报告注释中的 FIXIME
# report_fixme="Unnumbered"
# nightly, 元组模式匹配的时候允许使用 `..` 来匹配剩余元素
# condense_wildcard_suffixes=true
# nightly, 如果项目只在 Unix 平台下跑,可以设置该项为 Unix,表示换行符只依赖 Unix
newline_style="Unix"
# 不要将多个 Derive 宏合并为同一行
merge_derives = false
# nightly, 指定 fmt 忽略的目录
# ignore = [
# "src/test",
# "test",
# "docs",
# ]