如何在以IntelliJ或CLion保存文件时自动运行rustfmt?
发布于 2020-03-18 02:37:36
应该注意的是,虽然bit2Pixel的答案是有效的(实际上我在很长一段时间内都是这样做的),但还有一个更新的(更好的?)道路。rust-plugin有一个自动处理这个问题的选项。

发布于 2019-12-28 23:27:55
Preferences -> Plugins -> Installed安装了File Watchers插件。如果尚未安装,请转到Marketplace选项卡,搜索File Watchers,安装它,然后重新启动集成开发环境。Preferences -> Tools -> File Watchers.
rustfmt。
Program字段中输入rustfmt的路径;它可以在您的Cargo bin directory中找到。如果您不知道
Cargo bin directory目录的位置,请在终端中键入which rustfmt并复制路径。如果仍然找不到,请确保按照Installing Rust中的说明进行操作。

https://stackoverflow.com/questions/59512214
复制相似问题