diff options
Diffstat (limited to 'docs/user/features.md')
-rw-r--r-- | docs/user/features.md | 91 |
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 | ||
105 | See [assists.md](./assists.md) | 105 | See [assists.md](./assists.md) |
106 | 106 | ||
107 | - Add `#[derive]` | ||
108 | |||
109 | ```rust | ||
110 | // before: | ||
111 | struct Foo { | ||
112 | <|>x: i32 | ||
113 | } | ||
114 | // after: | ||
115 | #[derive(<|>)] | ||
116 | struct Foo { | ||
117 | x: i32 | ||
118 | } | ||
119 | ``` | ||
120 | |||
121 | - Add `impl` | ||
122 | |||
123 | ```rust | ||
124 | // before: | ||
125 | struct Foo<'a, T: Debug> { | ||
126 | <|>t: T | ||
127 | } | ||
128 | // after: | ||
129 | struct Foo<'a, T: Debug> { | ||
130 | t: T | ||
131 | } | ||
132 | |||
133 | impl<'a, T: Debug> Foo<'a, T> { | ||
134 | <|> | ||
135 | } | ||
136 | ``` | ||
137 | |||
138 | - Add missing `impl` members | ||
139 | |||
140 | ```rust | ||
141 | // before: | ||
142 | trait Foo { | ||
143 | fn foo(&self); | ||
144 | fn bar(&self); | ||
145 | fn baz(&self); | ||
146 | } | ||
147 | |||
148 | struct S; | ||
149 | |||
150 | impl Foo for S { | ||
151 | fn bar(&self) {} | ||
152 | <|> | ||
153 | } | ||
154 | |||
155 | // after: | ||
156 | trait Foo { | ||
157 | fn foo(&self); | ||
158 | fn bar(&self); | ||
159 | fn baz(&self); | ||
160 | } | ||
161 | |||
162 | struct S; | ||
163 | |||
164 | impl 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: | ||
175 | fn example(x: bool) -> bool { | ||
176 | !x || !x | ||
177 | } | ||
178 | |||
179 | // after: | ||
180 | fn 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: | ||
398 | fn foo() { | ||
399 | let t<|> = (&2, Some(1)); | ||
400 | } | ||
401 | // after: | ||
402 | fn 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: |