diff options
Diffstat (limited to 'docs/user/features.md')
-rw-r--r-- | docs/user/features.md | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/docs/user/features.md b/docs/user/features.md index eb81cba26..757a02838 100644 --- a/docs/user/features.md +++ b/docs/user/features.md | |||
@@ -166,6 +166,20 @@ impl Foo for S { | |||
166 | } | 166 | } |
167 | ``` | 167 | ``` |
168 | 168 | ||
169 | - Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws) | ||
170 | |||
171 | ```rust | ||
172 | // before: | ||
173 | fn example(x: bool) -> bool { | ||
174 | !x || !x | ||
175 | } | ||
176 | |||
177 | // after: | ||
178 | fn example(x: bool) -> bool { | ||
179 | !(x && x) | ||
180 | } | ||
181 | ``` | ||
182 | |||
169 | - Import path | 183 | - Import path |
170 | 184 | ||
171 | ```rust | 185 | ```rust |
@@ -353,9 +367,9 @@ impl VariantData { | |||
353 | 367 | ||
354 | ```rust | 368 | ```rust |
355 | // before: | 369 | // before: |
356 | use algo:<|>:visitor::{Visitor, visit}; | 370 | use crate:<|>:db::{RootDatabase, FileSymbol}; |
357 | // after: | 371 | // after: |
358 | use algo::{<|>visitor::{Visitor, visit}}; | 372 | use crate::{<|>db::{RootDatabase, FileSymbol}}; |
359 | ``` | 373 | ``` |
360 | 374 | ||
361 | - Flip binary expression | 375 | - Flip binary expression |