@@ -693,7 +693,7 @@ fn main() {
693
693
694
694
[discrete]
695
695
=== `convert_to_guarded_return`
696
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_to_guarded_return.rs#L21 [convert_to_guarded_return.rs]
696
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_to_guarded_return.rs#L24 [convert_to_guarded_return.rs]
697
697
698
698
Replace a large conditional with a guarded return.
699
699
@@ -944,7 +944,7 @@ fn main() {
944
944
945
945
[discrete]
946
946
=== `extract_function`
947
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L39 [extract_function.rs]
947
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L37 [extract_function.rs]
948
948
949
949
Extracts selected statements and comments into new function.
950
950
@@ -977,7 +977,7 @@ fn ┃fun_name(n: i32) {
977
977
978
978
[discrete]
979
979
=== `extract_module`
980
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_module.rs#L32 [extract_module.rs]
980
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_module.rs#L30 [extract_module.rs]
981
981
982
982
Extracts a selected region as separate module. All the references, visibility and imports are
983
983
resolved.
@@ -1251,7 +1251,7 @@ impl Default for Example {
1251
1251
1252
1252
[discrete]
1253
1253
=== `generate_delegate_methods`
1254
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_methods.rs#L17 [generate_delegate_methods.rs]
1254
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_methods.rs#L15 [generate_delegate_methods.rs]
1255
1255
1256
1256
Generate delegate methods.
1257
1257
@@ -1681,15 +1681,15 @@ struct Person {
1681
1681
1682
1682
impl Person {
1683
1683
fn ┃name(&self) -> &str {
1684
- self.name.as_ref()
1684
+ & self.name
1685
1685
}
1686
1686
}
1687
1687
```
1688
1688
1689
1689
1690
1690
[discrete]
1691
1691
=== `generate_getter_mut`
1692
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L113 [generate_getter_or_setter.rs]
1692
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L127 [generate_getter_or_setter.rs]
1693
1693
1694
1694
Generate a mut getter method.
1695
1695
@@ -1733,9 +1733,7 @@ struct Ctx<T: Clone> {
1733
1733
data: T,
1734
1734
}
1735
1735
1736
- impl<T: Clone> Ctx<T> {
1737
- ┃
1738
- }
1736
+ impl<T: Clone> Ctx<T> {┃}
1739
1737
```
1740
1738
1741
1739
@@ -1816,7 +1814,7 @@ impl<T> core::ops::Index<Axis> for [T; 3] {
1816
1814
1817
1815
[discrete]
1818
1816
=== `generate_new`
1819
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_new.rs#L13 [generate_new.rs]
1817
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_new.rs#L14 [generate_new.rs]
1820
1818
1821
1819
Adds a `fn new` for a type.
1822
1820
@@ -1834,7 +1832,9 @@ struct Ctx<T: Clone> {
1834
1832
}
1835
1833
1836
1834
impl<T: Clone> Ctx<T> {
1837
- fn ┃new(data: T) -> Self { Self { data } }
1835
+ fn ┃new(data: T) -> Self {
1836
+ Self { data }
1837
+ }
1838
1838
}
1839
1839
```
1840
1840
@@ -1928,7 +1928,7 @@ impl<const N: usize> ${0:TraitName}<N> for Foo<N> {
1928
1928
1929
1929
[discrete]
1930
1930
=== `generate_trait_impl`
1931
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L56 [generate_impl.rs]
1931
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L59 [generate_impl.rs]
1932
1932
1933
1933
Adds a new trait impl for a type.
1934
1934
@@ -1945,9 +1945,7 @@ struct Ctx<T: Clone> {
1945
1945
data: T,
1946
1946
}
1947
1947
1948
- impl<T: Clone> ┃ for Ctx<T> {
1949
-
1950
- }
1948
+ impl<T: Clone> ${0:_} for Ctx<T> {}
1951
1949
```
1952
1950
1953
1951
@@ -2348,7 +2346,7 @@ use std::{fmt::Formatter, io};
2348
2346
2349
2347
[discrete]
2350
2348
=== `merge_match_arms`
2351
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/merge_match_arms.rs#L11 [merge_match_arms.rs]
2349
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/merge_match_arms.rs#L12 [merge_match_arms.rs]
2352
2350
2353
2351
Merges the current match arm with the following if their bodies are identical.
2354
2352
@@ -3006,7 +3004,7 @@ fn main() {
3006
3004
3007
3005
[discrete]
3008
3006
=== `replace_derive_with_manual_impl`
3009
- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs#L18 [replace_derive_with_manual_impl.rs]
3007
+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs#L20 [replace_derive_with_manual_impl.rs]
3010
3008
3011
3009
Converts a `derive` impl into a manual one.
3012
3010
0 commit comments