From d9089245fefdc4179c1d61839e78131c5e5a5a45 Mon Sep 17 00:00:00 2001 From: Geoffrey Copin Date: Sat, 11 Apr 2020 20:32:58 +0200 Subject: Generate doc --- docs/user/assists.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/user/assists.md') diff --git a/docs/user/assists.md b/docs/user/assists.md index 754131f6f..75404e289 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md @@ -582,6 +582,21 @@ impl Walrus { } ``` +## `reorder_fields` + +Reorder the fields of record literals and record patterns in the same order as in +the definition. + +```rust +// BEFORE +struct Foo {foo: i32, bar: i32}; +const test: Foo = ┃Foo {bar: 0, foo: 1} + +// AFTER +struct Foo {foo: i32, bar: i32}; +const test: Foo = Foo {foo: 1, bar: 0} +``` + ## `replace_if_let_with_match` Replaces `if let` with an else branch with a `match` expression. -- cgit v1.2.3