Skip to content

Commit ffbb3ba

Browse files
committed
add example in Configuration doc
1 parent 6ae3c97 commit ffbb3ba

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

Configurations.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,12 +1042,42 @@ fn add_one(x: i32) -> i32 {
10421042

10431043
## `format_cargo_toml`
10441044

1045-
Format `Cargo.toml` files.
1045+
Format `Cargo.toml` files according to the [Cargo.toml conventions](https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/cargo.md).
10461046

10471047
- **Default value**: `false`
10481048
- **Possible values**: `true`, `false`
10491049
- **Stable**: No (tracking issue: [#4091](https://github.com/rust-lang/rustfmt/issues/4091))
10501050

1051+
#### `false` (default):
1052+
1053+
```toml
1054+
[package]
1055+
edition="2018"
1056+
1057+
version="0.1.0"
1058+
name="e"
1059+
[dependencies]
1060+
a="0.1"
1061+
1062+
1063+
c="0.3"
1064+
b="0.2"
1065+
```
1066+
1067+
#### `true`:
1068+
1069+
```toml
1070+
[package]
1071+
name = "e"
1072+
version = "0.1.0"
1073+
edition = "2018"
1074+
1075+
[dependencies]
1076+
a = "0.1"
1077+
b = "0.2"
1078+
c = "0.3"
1079+
```
1080+
10511081
## `doc_comment_code_block_width`
10521082

10531083
Max width for code snippets included in doc comments. Only used if [`format_code_in_doc_comments`](#format_code_in_doc_comments) is true.

0 commit comments

Comments
 (0)