Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'docs/book/src/assists_generated.md')
-rw-r--r--docs/book/src/assists_generated.md178
1 files changed, 89 insertions, 89 deletions
diff --git a/docs/book/src/assists_generated.md b/docs/book/src/assists_generated.md
index 2d233ca62a..743e5c5e10 100644
--- a/docs/book/src/assists_generated.md
+++ b/docs/book/src/assists_generated.md
@@ -28,6 +28,32 @@ fn foo(n: i32) -> i32 {
```
+### `add_explicit_enum_discriminant`
+**Source:** [add_explicit_enum_discriminant.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_explicit_enum_discriminant.rs#L11)
+
+Adds explicit discriminant to all enum variants.
+
+#### Before
+```rust
+enum TheEnum┃ {
+ Foo,
+ Bar,
+ Baz = 42,
+ Quux,
+}
+```
+
+#### After
+```rust
+enum TheEnum {
+ Foo = 0,
+ Bar = 1,
+ Baz = 42,
+ Quux = 43,
+}
+```
+
+
### `add_explicit_type`
**Source:** [add_explicit_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_explicit_type.rs#L7)
@@ -257,7 +283,7 @@ fn main() {
### `apply_demorgan`
-**Source:** [apply_demorgan.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L16)
+**Source:** [apply_demorgan.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L23)
Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws).
This transforms expressions of the form `!l || !r` into `!(l && r)`.
@@ -280,7 +306,7 @@ fn main() {
### `apply_demorgan_iterator`
-**Source:** [apply_demorgan.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L147)
+**Source:** [apply_demorgan.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L154)
Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws) to
`Iterator::all` and `Iterator::any`.
@@ -350,40 +376,6 @@ fn some_function(x: i32) {
```
-### `bool_to_enum`
-**Source:** [bool_to_enum.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/bool_to_enum.rs#L29)
-
-This converts boolean local variables, fields, constants, and statics into a new
-enum with two variants `Bool::True` and `Bool::False`, as well as replacing
-all assignments with the variants and replacing all usages with `== Bool::True` or
-`== Bool::False`.
-
-#### Before
-```rust
-fn main() {
- let ┃bool = true;
-
- if bool {
- println!("foo");
- }
-}
-```
-
-#### After
-```rust
-#[derive(PartialEq, Eq)]
-enum Bool { True, False }
-
-fn main() {
- let bool = Bool::True;
-
- if bool == Bool::True {
- println!("foo");
- }
-}
-```
-
-
### `change_visibility`
**Source:** [change_visibility.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/change_visibility.rs#L13)
@@ -442,6 +434,40 @@ fn main() {
```
+### `convert_bool_to_enum`
+**Source:** [convert_bool_to_enum.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_bool_to_enum.rs#L29)
+
+This converts boolean local variables, fields, constants, and statics into a new
+enum with two variants `Bool::True` and `Bool::False`, as well as replacing
+all assignments with the variants and replacing all usages with `== Bool::True` or
+`== Bool::False`.
+
+#### Before
+```rust
+fn main() {
+ let ┃bool = true;
+
+ if bool {
+ println!("foo");
+ }
+}
+```
+
+#### After
+```rust
+#[derive(PartialEq, Eq)]
+enum Bool { True, False }
+
+fn main() {
+ let bool = Bool::True;
+
+ if bool == Bool::True {
+ println!("foo");
+ }
+}
+```
+
+
### `convert_closure_to_fn`
**Source:** [convert_closure_to_fn.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_closure_to_fn.rs#L25)
@@ -1043,28 +1069,26 @@ pub use foo::{Bar, Baz};
```
-### `explicit_enum_discriminant`
-**Source:** [explicit_enum_discriminant.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/explicit_enum_discriminant.rs#L11)
+### `expand_rest_pattern`
+**Source:** [expand_rest_pattern.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/expand_rest_pattern.rs#L8)
-Adds explicit discriminant to all enum variants.
+Fills fields by replacing rest pattern in record patterns.
#### Before
```rust
-enum TheEnum┃ {
- Foo,
- Bar,
- Baz = 42,
- Quux,
+struct Bar { y: Y, z: Z }
+
+fn foo(bar: Bar) {
+ let Bar { ..┃ } = bar;
}
```
#### After
```rust
-enum TheEnum {
- Foo = 0,
- Bar = 1,
- Baz = 42,
- Quux = 43,
+struct Bar { y: Y, z: Z }
+
+fn foo(bar: Bar) {
+ let Bar { y, z } = bar;
}
```
@@ -1255,30 +1279,6 @@ fn main() {
```
-### `fill_record_pattern_fields`
-**Source:** [fill_record_pattern_fields.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/fill_record_pattern_fields.rs#L8)
-
-Fills fields by replacing rest pattern in record patterns.
-
-#### Before
-```rust
-struct Bar { y: Y, z: Z }
-
-fn foo(bar: Bar) {
- let Bar { ..┃ } = bar;
-}
-```
-
-#### After
-```rust
-struct Bar { y: Y, z: Z }
-
-fn foo(bar: Bar) {
- let Bar { y, z } = bar;
-}
-```
-
-
### `fix_visibility`
**Source:** [fix_visibility.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/fix_visibility.rs#L14)
@@ -2403,22 +2403,6 @@ fn main() -> () {
```
-### `introduce_named_generic`
-**Source:** [introduce_named_generic.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/introduce_named_generic.rs#L7)
-
-Replaces `impl Trait` function argument with the named generic.
-
-#### Before
-```rust
-fn foo(bar: ┃impl Bar) {}
-```
-
-#### After
-```rust
-fn foo<┃B: Bar>(bar: B) {}
-```
-
-
### `introduce_named_lifetime`
**Source:** [introduce_named_lifetime.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/introduce_named_lifetime.rs#L13)
@@ -2447,6 +2431,22 @@ impl<'a> Cursor<'a> {
```
+### `introduce_named_type_parameter`
+**Source:** [introduce_named_type_parameter.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/introduce_named_type_parameter.rs#L7)
+
+Replaces `impl Trait` function argument with the named generic.
+
+#### Before
+```rust
+fn foo(bar: ┃impl Bar) {}
+```
+
+#### After
+```rust
+fn foo<┃B: Bar>(bar: B) {}
+```
+
+
### `invert_if`
**Source:** [invert_if.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/invert_if.rs#L13)