Format Rust code
merge_imports
configuration has been deprecated in favor of the new imports_granularity
option. Any existing usage of merge_imports
will be automatically mapped to the corresponding value on imports_granularity
with a warning message printed to encourage users to update their config files.imports_granularity
option has been added which succeeds merge_imports
. This new option supports several additional variants which allow users to merge imports at different levels (crate or module), and even flatten imports to have a single use statement per item. (PR #4634, PR #4639)See the section on the configuration site for more information https://rust-lang.github.io/rustfmt/?version=v1.4.33&search=#imports_granularity
const
keyword on const trait impl (#4084)indent_style
is overridden to Visual
. (#4584)err
and typeof
types (#4357, #4586)rustc-ap-*
crates updated to v691.0.0cfg_if
condition, rustfmt will now attempt to continue and format the imported modules. Previously rustfmt would emit the parser error about an inner attribute being invalid in this position, but for rustfmt's purposes the invalid attribute doesn't prevent nor impact module formatting.group_imports
- a new configuration option that allows users to control the strategy used for grouping imports (#4107)hard_tabs
is enabled. (#4152)&
operator, lifetime, mut
kw, type} are no longer dropped. (#4245)where_single_line
is no longer incorrectly applied to multiline function signatures that have no where
clause. (#4547)