我有一个rustfmt.toml文件,其中包含行group_imports = "StdExternalCrate",根据文献资料,这应该是一个有效的选项。但是,我收到以下警告:
警告:未知配置选项
group\_imports
在测试文件上运行rustfmt似乎也不像指定的那样对导入进行分组。今天,我用rustup update更新了所有内容,目前有"rustfmt 1.4.27-nightly“版本,似乎是最新的稳定小版本。
我还确保使用unstable_features = true启用不稳定特性,如文档所示。为什么我不能用这个选项?是因为我每晚都在用吗?在这种情况下,我怎样才能实现这个选项呢?
完整的rustfmt.toml文件供参考:
edition = "2018"
unstable_features = true
format_code_in_doc_comments = true
brace_style = "AlwaysNextLine"
control_brace_style = "AlwaysNextLine"
fn_single_line = true
where_single_line = true
blank_lines_upper_bound = 2
inline_attribute_width = 32
reorder_impl_items = true
group_imports = "StdExternalCrate"
enum_discrim_align_threshold = 16
struct_field_align_threshold = 16发布于 2021-01-02 06:58:35
在从机箱中提取的版本中,该选项根本不可用。文档指向后来(当时)未发布的代码。根据文档,该选项可在2.0.0版中使用。
https://stackoverflow.com/questions/65138813
复制相似问题