|
1 | 1 | //Generated file, do not edit by hand, see `xtask/src/codegen`
|
2 |
| -[discrete] |
3 |
| -=== `add_custom_impl` |
4 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/add_custom_impl.rs#L19[add_custom_impl.rs] |
5 |
| - |
6 |
| -Adds impl block for derived trait. |
7 |
| - |
8 |
| -.Before |
9 |
| -```rust |
10 |
| -#[derive(Deb┃ug, Display)] |
11 |
| -struct S; |
12 |
| -``` |
13 |
| - |
14 |
| -.After |
15 |
| -```rust |
16 |
| -#[derive(Display)] |
17 |
| -struct S; |
18 |
| - |
19 |
| -impl Debug for S { |
20 |
| - $0 |
21 |
| -} |
22 |
| -``` |
23 |
| - |
24 |
| - |
25 | 2 | [discrete]
|
26 | 3 | === `add_explicit_type`
|
27 | 4 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/add_explicit_type.rs#L9[add_explicit_type.rs]
|
@@ -208,23 +185,6 @@ fn main() {
|
208 | 185 | ```
|
209 | 186 |
|
210 | 187 |
|
211 |
| -[discrete] |
212 |
| -=== `change_return_type_to_result` |
213 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/change_return_type_to_result.rs#L11[change_return_type_to_result.rs] |
214 |
| - |
215 |
| -Change the function's return type to Result. |
216 |
| - |
217 |
| -.Before |
218 |
| -```rust |
219 |
| -fn foo() -> i32┃ { 42i32 } |
220 |
| -``` |
221 |
| - |
222 |
| -.After |
223 |
| -```rust |
224 |
| -fn foo() -> Result<i32, ${0:_}> { Ok(42i32) } |
225 |
| -``` |
226 |
| - |
227 |
| - |
228 | 188 | [discrete]
|
229 | 189 | === `change_visibility`
|
230 | 190 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/change_visibility.rs#L11[change_visibility.rs]
|
@@ -320,7 +280,7 @@ fn qux(bar: Bar, baz: Baz) {}
|
320 | 280 |
|
321 | 281 | [discrete]
|
322 | 282 | === `extract_struct_from_enum_variant`
|
323 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/extract_struct_from_enum_variant.rs#L19[extract_struct_from_enum_variant.rs] |
| 283 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/extract_struct_from_enum_variant.rs#L18[extract_struct_from_enum_variant.rs] |
324 | 284 |
|
325 | 285 | Extracts a struct from enum variant.
|
326 | 286 |
|
@@ -1001,6 +961,31 @@ const test: Foo = Foo {foo: 1, bar: 0}
|
1001 | 961 | ```
|
1002 | 962 |
|
1003 | 963 |
|
| 964 | +[discrete] |
| 965 | +=== `replace_derive_with_manual_impl` |
| 966 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/replace_derive_with_manual_impl.rs#L19[replace_derive_with_manual_impl.rs] |
| 967 | + |
| 968 | +Converts a `derive` impl into a manual one. |
| 969 | + |
| 970 | +.Before |
| 971 | +```rust |
| 972 | +#[derive(Deb┃ug, Display)] |
| 973 | +struct S; |
| 974 | +``` |
| 975 | + |
| 976 | +.After |
| 977 | +```rust |
| 978 | +#[derive(Display)] |
| 979 | +struct S; |
| 980 | + |
| 981 | +impl Debug for S { |
| 982 | + fn fmt(&self, f: &mut Formatter) -> Result<()> { |
| 983 | + ${0:todo!()} |
| 984 | + } |
| 985 | +} |
| 986 | +``` |
| 987 | + |
| 988 | + |
1004 | 989 | [discrete]
|
1005 | 990 | === `replace_if_let_with_match`
|
1006 | 991 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/replace_if_let_with_match.rs#L13[replace_if_let_with_match.rs]
|
@@ -1184,3 +1169,20 @@ fn foo() {
|
1184 | 1169 | println!("foo");
|
1185 | 1170 | }
|
1186 | 1171 | ```
|
| 1172 | + |
| 1173 | + |
| 1174 | +[discrete] |
| 1175 | +=== `wrap_return_type_in_result` |
| 1176 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/wrap_return_type_in_result.rs#L11[wrap_return_type_in_result.rs] |
| 1177 | + |
| 1178 | +Wrap the function's return type into Result. |
| 1179 | + |
| 1180 | +.Before |
| 1181 | +```rust |
| 1182 | +fn foo() -> i32┃ { 42i32 } |
| 1183 | +``` |
| 1184 | + |
| 1185 | +.After |
| 1186 | +```rust |
| 1187 | +fn foo() -> Result<i32, ${0:_}> { Ok(42i32) } |
| 1188 | +``` |
0 commit comments