diff options
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/features.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/user/features.md b/docs/user/features.md index eb81cba26..0ce8f577b 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 |