Formatting Rust: group and sort imports

I'd like to have some rustfmt options that are unstable.

Do we have alternatives to achieve it without nightly? Using the nightly toolchain just for rustfmt seems somewhat inconvenient to me, but maybe that's what some do.

reorder_imports = true
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
reorder_modules = true

If you are using rustup as your installer you can use toolchain overrides, which I find easy enough to type to switch toolchains between different invocations of Cargo:

cargo +nightly fmt
1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.