Skip to content

Commit

Permalink
Update rustfmt.toml options for compatibility with modern rustfmt
Browse files Browse the repository at this point in the history
Running `cargo fmt` or `cargo +nightly fmt` gives the following
warnings:
```
Warning: Unknown configuration option `fn_brace_style`
Warning: Unknown configuration option `item_brace_style`
Warning: Unknown configuration option `struct_lit_multiline_style`
Warning: Unknown configuration option `where_trailing_comma`
```

rustfmt changed these options here, and this PR reflects the changes:
* `fn_brace_style` and `item_brace_style` were folded into
  `brace_style`: rust-lang/rustfmt@f8074b3#diff-6d8a5e2104954a026de2bfe2b936aea4R541
* `struct_lit_multiline_style` option was renamed to
  `struct_lit_single_line`: rust-lang/rustfmt@45d4f7a#diff-9de0a570da3404ffd4b364ef6a9f8195L1749
* `where_trailing_comma` was removed, but appears to have no
   replacement: rust-lang/rustfmt@6a58d91#diff-6d8a5e2104954a026de2bfe2b936aea4L369
   So I left it in.

Running `cargo fmt` over the bindgen codebase produces a _lot_ of
changes, so I haven't done that. But I think it'd be a good idea to do
it at some point: opening PRs against a project that has its own
rustfmt.toml file but doesn't seem to follow it is a confusing process.
  • Loading branch information
Wallacoloo authored and emilio committed Jun 6, 2019
1 parent d55cce5 commit 6aa5b2b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
max_width = 80
fn_brace_style = "SameLineWhere"
item_brace_style = "SameLineWhere"
struct_lit_multiline_style = "ForceMulti"
brace_style = "SameLineWhere"
struct_lit_single_line = false
where_trailing_comma = true
normalize_comments = false

0 comments on commit 6aa5b2b

Please sign in to comment.