## `disable_all_formatting`
-Don't reformat anything
+Don't reformat anything.
+
+Note that this option may be soft-deprecated in the future once the [ignore](#ignore) option is stabilized. Nightly toolchain users are encouraged to use [ignore](#ignore) instead when possible.
- **Default value**: `false`
- **Possible values**: `true`, `false`
-- **Stable**: No (tracking issue: #3388)
+- **Stable**: Yes
## `edition`
}
```
+## `format_generated_files`
+
+Format generated files. A file is considered generated
+if any of the first five lines contains `@generated` marker.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No
+
## `format_macro_matchers`
Format the metavariable matching patterns in macros.
See also: [`tab_spaces`](#tab_spaces).
+## `hex_literal_case`
+
+Control the case of the letters in hexadecimal literal values
+
+- **Default value**: `Preserve`
+- **Possible values**: `Upper`, `Lower`
+- **Stable**: No
## `hide_parse_errors`
- **Default value**: `false`
- **Possible values**: `true`, `false`
-- **Stable**: No (tracking issue: #3380)
+- **Stable**: Yes
#### `false` (default):
#### `false`:
```rust
+#[derive(Eq, PartialEq, Debug, Copy, Clone)]
+pub enum Bar {}
+
#[derive(Eq, PartialEq)]
#[derive(Debug)]
#[derive(Copy, Clone)]
How imports should be grouped into `use` statements. Imports will be merged or split to the configured level of granularity.
- **Default value**: `Preserve`
-- **Possible values**: `Preserve`, `Crate`, `Module`, `Item`
+- **Possible values**: `Preserve`, `Crate`, `Module`, `Item`, `One`
- **Stable**: No
#### `Preserve` (default):
use qux::i;
```
+#### `One`:
+
+Merge all imports into a single `use` statement as long as they have the same visibility.
+
+```rust
+pub use foo::{x, y};
+use {
+ bar::{
+ a,
+ b::{self, f, g},
+ c,
+ d::e,
+ },
+ qux::{h, i},
+};
+```
+
## `merge_imports`
This option is deprecated. Use `imports_granularity = "Crate"` instead.
#![doc = "Example documentation"]
#[doc = "Example item documentation"]
+pub enum Bar {}
+
+/// Example item documentation
pub enum Foo {}
```
#### `false`:
```rust
fn main() {
+ (foo());
+
((((foo()))));
}
```
type Item = i32;
}
+
+impl Iterator for Dummy {
+ type Item = i32;
+
+ fn next(&mut self) -> Option<Self::Item> {
+ None
+ }
+}
```
#### `true`
Controls the strategy for how imports are grouped together.
- **Default value**: `Preserve`
-- **Possible values**: `Preserve`, `StdExternalCrate`
+- **Possible values**: `Preserve`, `StdExternalCrate`, `One`
- **Stable**: No
#### `Preserve` (default):
use crate::models::Event;
```
+#### `One`:
+
+Discard existing import groups, and create a single group for everything
+
+```rust
+use super::schema::{Context, Payload};
+use super::update::convert_publish_payload;
+use crate::models::Event;
+use alloc::alloc::Layout;
+use broker::database::PooledConnection;
+use chrono::Utc;
+use core::f32;
+use juniper::{FieldError, FieldResult};
+use std::sync::Arc;
+use uuid::Uuid;
+```
+
## `reorder_modules`
Reorder `mod` declarations alphabetically in group.
let x = 1;
let y = 2;
let z = 3;
- let a = Foo { x: x, y: y, z: z };
+ let a = Foo { x, y, z };
+ let b = Foo { x: x, y: y, z: z };
}
```
```rust
fn main() {
+ let lorem = ipsum.map(|dolor| dolor.sit())?;
+
let lorem = try!(ipsum.map(|dolor| dolor.sit()));
}
```
#### `false` (default):
```rust
+// Lorem ipsum dolor sit amet, consectetur adipiscing elit,
+// sed do eiusmod tempor incididunt ut labore et dolore
+// magna aliqua. Ut enim ad minim veniam, quis nostrud
+// exercitation ullamco laboris nisi ut aliquip ex ea
+// commodo consequat.
+
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
```