加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rustfmt.toml 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
Philip Degarmo 提交于 2019-11-30 18:19 . Add clippy to CI, fix a newer lint
# Many of the imports and modules are in "conceptual" order, for example
# similar imports/modules are next to each other in order.
reorder_imports = false
reorder_modules = false
# This makes merge conflicts less likely to occur, and makes it easier to see
# symmetry between parameters.
fn_args_layout = "Vertical"
# Once TODOs are cleared we can turn this on
# report_todo = "Unnumbered"
# report_fixme = "Unnumbered"
# Things I'd like to turn on if it's ever supported in cargo fmt
#
# ----- Force unsafe blocks to be multi-line -----
#
# I'd like for unsafe blocks to be forced onto new lines, both before
# the unsafe and after the "unsafe {". New line before the unsafe
# could be omitted in simple let statements
#
# CURRENT BEHAVIOR
#
# semaphors.push(unsafe { vkCreateSemaphore() });
#
# let x = unsafe { get_x() };
#
# DESIRED BEHAVIOR
#
# semaphors.push(
# unsafe {
# vkCreateSemaphore();
# }
# )
#
# let x = unsafe {
# get_x();
# }
#
# RATIONALE
#
# This would make unsafe code more conspicuous. One workaround for
# particularly bad cases like the first example is to break it to
# multiple lines.
#
# ----- fn_args_layout for callsites -----
#
# I'd like the "vetical" behavior for fn_args_layout applied at callsites
# as well
#
# CURRENT BEHAVIOR
#
# draw_circle(radius, position, color);
#
# LogicalPosition::new(p0.x - p1.x, p0.y - p1.y)
#
# DESIRED BEHAVIOR
#
# draw_circle
# radius,
# position,
# color
# );
#
# LogicalPosition::new(
# p0.x - p1.x,
# p0.y - p1.y
# );
#
# RATIONALE
#
# It's not uncommon to insert new parameters, or change parameters,
# being passed into a function. Merge conflicts are less likely to
# happen if each argument gets its own line.
#
# In some cases there is symmetry that is helpful to see. When the
# the symmetry is broken, it's more conspicuous. This can make bugs
# easier to spot, or if it's not a bug, help the reader to see this.
#
# As a bonus it's also more consistent with fn_args_layout
#
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化