From fe8ec1c045af7a41492d0df6d271f1ce56afb51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=BAc=C3=A1s=20Meier?= Date: Fri, 4 Oct 2019 11:03:35 +0200 Subject: [#1807] Add entry in docs/user/features --- docs/user/features.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs/user/features.md') diff --git a/docs/user/features.md b/docs/user/features.md index eb81cba26..f89d8c489 100644 --- a/docs/user/features.md +++ b/docs/user/features.md @@ -166,6 +166,20 @@ impl Foo for S { } ``` +- Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws) + +```rust +// before: +fn example(x: bool) -> bool { + !x || !x +} + +// after: +fn example(x: bool) -> bool { + !(x && !x) +} +``` + - Import path ```rust -- cgit v1.2.3