aboutsummaryrefslogtreecommitdiff
path: root/docs/user/features.md
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-25 21:38:15 +0100
committerAleksey Kladov <[email protected]>2019-10-25 21:38:15 +0100
commitd385438bcc8d302fbcb91114e19ac0cc30528822 (patch)
treed57842c6462f4921976d6d9642ce7751681cf0bd /docs/user/features.md
parente6cb06d2850b9b9c38c0c13d6948ab39adcd652e (diff)
generate more assists docs
Diffstat (limited to 'docs/user/features.md')
-rw-r--r--docs/user/features.md91
1 files changed, 0 insertions, 91 deletions
diff --git a/docs/user/features.md b/docs/user/features.md
index a94b65ad4..acf092cec 100644
--- a/docs/user/features.md
+++ b/docs/user/features.md
@@ -104,84 +104,6 @@ the VS Code side to be able to position cursor. `<|>` signifies cursor
104 104
105See [assists.md](./assists.md) 105See [assists.md](./assists.md)
106 106
107- Add `#[derive]`
108
109```rust
110// before:
111struct Foo {
112 <|>x: i32
113}
114// after:
115#[derive(<|>)]
116struct Foo {
117 x: i32
118}
119```
120
121- Add `impl`
122
123```rust
124// before:
125struct Foo<'a, T: Debug> {
126 <|>t: T
127}
128// after:
129struct Foo<'a, T: Debug> {
130 t: T
131}
132
133impl<'a, T: Debug> Foo<'a, T> {
134 <|>
135}
136```
137
138- Add missing `impl` members
139
140```rust
141// before:
142trait Foo {
143 fn foo(&self);
144 fn bar(&self);
145 fn baz(&self);
146}
147
148struct S;
149
150impl Foo for S {
151 fn bar(&self) {}
152 <|>
153}
154
155// after:
156trait Foo {
157 fn foo(&self);
158 fn bar(&self);
159 fn baz(&self);
160}
161
162struct S;
163
164impl Foo for S {
165 fn bar(&self) {}
166 fn foo(&self) { unimplemented!() }
167 fn baz(&self) { unimplemented!() }<|>
168}
169```
170
171- Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws)
172
173```rust
174// before:
175fn example(x: bool) -> bool {
176 !x || !x
177}
178
179// after:
180fn example(x: bool) -> bool {
181 !(x && x)
182}
183```
184
185- Import path 107- Import path
186 108
187```rust 109```rust
@@ -391,19 +313,6 @@ fn foo() {
391} 313}
392``` 314```
393 315
394- Add explicit type
395
396```rust
397// before:
398fn foo() {
399 let t<|> = (&2, Some(1));
400}
401// after:
402fn foo() {
403 let t<|>: (&i32, Option<i32>) = (&2, Some(1));
404}
405```
406
407- Move guard expression to match arm body 316- Move guard expression to match arm body
408```rust 317```rust
409// before: 318// before: