1
Fork 0

docs: expand behavior of imports_granularity re: groups (#5543)

This commit is contained in:
Caleb Cartwright 2022-09-19 17:58:37 -05:00 committed by GitHub
parent 38659ec6ad
commit ef91154250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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):