Skip to content

Commit 42ef5bd

Browse files
authored
同步fmt 注意事项 (#104)
1 parent 75ae109 commit 42ef5bd

File tree

1 file changed

+6
-0
lines changed
  • src/safe-guides/code_style

1 file changed

+6
-0
lines changed

src/safe-guides/code_style/fmt.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Rust 有自动化格式化工具 rustfmt ,可以帮助开发者摆脱手工调
1010

1111
如需了解在稳定版 Rust 中使用未稳定配置项的方法、配置示例及其他全局配置项说明,请参阅:[Rustfmt 配置相关说明](./../Appendix/tools/rustfmt.md)
1212

13+
**【注意事项】**
14+
15+
因为 rustfmt 工具会自动修改代码,为了确保 rustfmt 不会因为意外而改错代码,所以在使用 rustfmt 时应该注意下面两项描述:
16+
17+
1. 务必保证在全部把代码修改完毕且编译通过之后再执行 rustfmt 命令。 因为 rustfmt 执行过程中不会对代码进行编译,所以就不会有静态检查保护。
18+
2. 如果是使用 IDE 或 编辑器的时候开启了自动保护功能,就不要开启自动执行 rustfmt 功能。
1319

1420
## 列表
1521

0 commit comments

Comments
 (0)