diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/assists.md | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index 754131f6f..6483ba4f3 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -77,7 +77,7 @@ fn foo() { | |||
77 | } | 77 | } |
78 | 78 | ||
79 | fn bar(arg: &str, baz: Baz) { | 79 | fn bar(arg: &str, baz: Baz) { |
80 | unimplemented!() | 80 | todo!() |
81 | } | 81 | } |
82 | 82 | ||
83 | ``` | 83 | ``` |
@@ -175,7 +175,7 @@ trait Trait<T> { | |||
175 | } | 175 | } |
176 | 176 | ||
177 | impl Trait<u32> for () { | 177 | impl Trait<u32> for () { |
178 | fn foo(&self) -> u32 { unimplemented!() } | 178 | fn foo(&self) -> u32 { todo!() } |
179 | 179 | ||
180 | } | 180 | } |
181 | ``` | 181 | ``` |
@@ -582,6 +582,21 @@ impl Walrus { | |||
582 | } | 582 | } |
583 | ``` | 583 | ``` |
584 | 584 | ||
585 | ## `reorder_fields` | ||
586 | |||
587 | Reorder the fields of record literals and record patterns in the same order as in | ||
588 | the definition. | ||
589 | |||
590 | ```rust | ||
591 | // BEFORE | ||
592 | struct Foo {foo: i32, bar: i32}; | ||
593 | const test: Foo = ┃Foo {bar: 0, foo: 1} | ||
594 | |||
595 | // AFTER | ||
596 | struct Foo {foo: i32, bar: i32}; | ||
597 | const test: Foo = Foo {foo: 1, bar: 0} | ||
598 | ``` | ||
599 | |||
585 | ## `replace_if_let_with_match` | 600 | ## `replace_if_let_with_match` |
586 | 601 | ||
587 | Replaces `if let` with an else branch with a `match` expression. | 602 | Replaces `if let` with an else branch with a `match` expression. |