为什么 rustfmt 在下面的代码示例中发出缩进空格,以及如何将其配置为停止?
我有以下代码:
fn main() {
if {
let to_comp = true;
if to_comp { true } else { false }
} {
println!("true");
}
}
Run Code Online (Sandbox Code Playgroud)
rustfmt 格式为(我已替换所有制表符--->和缩进空格以_说明缩进):
fn main() {
--->if {
--->--->___let to_comp = true;
--->--->___if to_comp { true } else { false }
--->--->__} {
--->--->println!("true");
--->}
}
Run Code Online (Sandbox Code Playgroud)
我rustfmt.toml的上述代码:
tab_spaces = 4
hard_tabs = true
array_layout = "Block"
reorder_imports = true
newline_style = "Unix"
spaces_within_angle_brackets = false
spaces_within_parens …Run Code Online (Sandbox Code Playgroud) rust ×1