You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal : rewrite DeMorgan assist
fixes#15239 , #15240 . This PR is a rewrite of the DeMorgan assist that essentially rids of all the string manipulation and modifies syntax trees to apply demorgan on a binary expr. The main reason for the rewrite is that I wanted to use `Expr::needs_parens_in` method to see if the expr on which the assist is applied would still need the parens it had once the parent expression's operator had equal precedence with that of the expression. I used `.clone_(subtree|for_update)` left and right and probably more than I should have, so I would also be happy to hear how I could have prevented redundant cloning.
Uh oh!
There was an error while loading. Please reload this page.
Applying the assist as follows:
Generates the following code:
A similar issue occurs when you start with
_ = !a ||$0 (b);
instead.rust-analyzer version: rust-analyzer version: 0.3.1575-standalone (ff485b6 2023-07-02)
rustc version: rustc 1.70.0 (90c541806 2023-05-31)
relevant settings: Not Applicable
The text was updated successfully, but these errors were encountered: