diff options
Diffstat (limited to 'crates/ra_assists/src/assists/apply_demorgan.rs')
-rw-r--r-- | crates/ra_assists/src/assists/apply_demorgan.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_assists/src/assists/apply_demorgan.rs b/crates/ra_assists/src/assists/apply_demorgan.rs index a072f63e7..75144cefe 100644 --- a/crates/ra_assists/src/assists/apply_demorgan.rs +++ b/crates/ra_assists/src/assists/apply_demorgan.rs | |||
@@ -5,11 +5,13 @@ use ra_syntax::SyntaxNode; | |||
5 | use crate::{Assist, AssistCtx, AssistId}; | 5 | use crate::{Assist, AssistCtx, AssistId}; |
6 | 6 | ||
7 | // Assist: apply_demorgan | 7 | // Assist: apply_demorgan |
8 | // | ||
8 | // Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). | 9 | // Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). |
9 | // This transforms expressions of the form `!l || !r` into `!(l && r)`. | 10 | // This transforms expressions of the form `!l || !r` into `!(l && r)`. |
10 | // This also works with `&&`. This assist can only be applied with the cursor | 11 | // This also works with `&&`. This assist can only be applied with the cursor |
11 | // on either `||` or `&&`, with both operands being a negation of some kind. | 12 | // on either `||` or `&&`, with both operands being a negation of some kind. |
12 | // This means something of the form `!x` or `x != y`. | 13 | // This means something of the form `!x` or `x != y`. |
14 | // | ||
13 | // ``` | 15 | // ``` |
14 | // fn main() { | 16 | // fn main() { |
15 | // if x != 4 ||<|> !y {} | 17 | // if x != 4 ||<|> !y {} |