Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: expand behavior of imports_granularity re: groups #5543

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1857,13 +1857,16 @@ pub enum Foo {}

## `imports_granularity`

How imports should be grouped into `use` statements. Imports will be merged or split to the configured level of granularity.
Controls how imports are structured in `use` statements. Imports will be merged or split to the configured level of granularity.

Similar to other `import` related configuration options, this option operates within the bounds of user-defined groups of imports. See [`group_imports`](#group_imports) for more information on import groups.

Note that rustfmt will not modify the granularity of imports containing comments if doing so could potentially lose or misplace said comments.

- **Default value**: `Preserve`
- **Possible values**: `Preserve`, `Crate`, `Module`, `Item`, `One`
- **Stable**: No (tracking issue: [#4991](https://github.com/rust-lang/rustfmt/issues/4991))

Note that rustfmt will not modify the granularity of imports containing comments if doing so could potentially lose or misplace said comments.

#### `Preserve` (default):

Expand Down