diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-25 07:04:47 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-25 07:04:47 +0000 |
commit | 965363db15a259929286f80f95c603594366bad6 (patch) | |
tree | 7d404561e0b8a9b2f23274c07895e6ee14692910 /crates/ra_hir/src | |
parent | 219b1573377caafaca1dc071f8513ec8be01f199 (diff) | |
parent | 67055c47da2c94188540847b33921af25652156a (diff) |
Merge #1036
1036: Assist to flip equality (==) and negated equality (!=) operands. r=matklad a=marcogroppo
This PR adds an assist to flip the equality operands.
I hope this is the right way to do this (I'm a newbie...)
Fixes #1023.
Co-authored-by: Marco Groppo <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 703d99d9b..c37fd0454 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -680,7 +680,7 @@ impl ExprCollector { | |||
680 | } | 680 | } |
681 | ast::ExprKind::PrefixExpr(e) => { | 681 | ast::ExprKind::PrefixExpr(e) => { |
682 | let expr = self.collect_expr_opt(e.expr()); | 682 | let expr = self.collect_expr_opt(e.expr()); |
683 | if let Some(op) = e.op() { | 683 | if let Some(op) = e.op_kind() { |
684 | self.alloc_expr(Expr::UnaryOp { expr, op }, syntax_ptr) | 684 | self.alloc_expr(Expr::UnaryOp { expr, op }, syntax_ptr) |
685 | } else { | 685 | } else { |
686 | self.alloc_expr(Expr::Missing, syntax_ptr) | 686 | self.alloc_expr(Expr::Missing, syntax_ptr) |
@@ -703,7 +703,7 @@ impl ExprCollector { | |||
703 | ast::ExprKind::BinExpr(e) => { | 703 | ast::ExprKind::BinExpr(e) => { |
704 | let lhs = self.collect_expr_opt(e.lhs()); | 704 | let lhs = self.collect_expr_opt(e.lhs()); |
705 | let rhs = self.collect_expr_opt(e.rhs()); | 705 | let rhs = self.collect_expr_opt(e.rhs()); |
706 | let op = e.op(); | 706 | let op = e.op_kind(); |
707 | self.alloc_expr(Expr::BinaryOp { lhs, rhs, op }, syntax_ptr) | 707 | self.alloc_expr(Expr::BinaryOp { lhs, rhs, op }, syntax_ptr) |
708 | } | 708 | } |
709 | ast::ExprKind::TupleExpr(e) => { | 709 | ast::ExprKind::TupleExpr(e) => { |