diff options
author | Jeremy Kolb <[email protected]> | 2020-01-04 20:54:31 +0000 |
---|---|---|
committer | Jeremy Kolb <[email protected]> | 2020-01-04 20:54:31 +0000 |
commit | 5afb22e2b383a2894297f3508cd3e954da96da1c (patch) | |
tree | 75f478c3e67bcf97b92c4b73cbed1b85e82a2a94 /crates/ra_assists/src/assists | |
parent | c15293e0193008fb855ed49e8deb533dfaa3e9c7 (diff) |
BinOp helper to detect assignment
Diffstat (limited to 'crates/ra_assists/src/assists')
-rw-r--r-- | crates/ra_assists/src/assists/flip_binexpr.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/crates/ra_assists/src/assists/flip_binexpr.rs b/crates/ra_assists/src/assists/flip_binexpr.rs index 386045eb0..2d91b2a7e 100644 --- a/crates/ra_assists/src/assists/flip_binexpr.rs +++ b/crates/ra_assists/src/assists/flip_binexpr.rs | |||
@@ -56,17 +56,7 @@ enum FlipAction { | |||
56 | impl From<BinOp> for FlipAction { | 56 | impl From<BinOp> for FlipAction { |
57 | fn from(op_kind: BinOp) -> Self { | 57 | fn from(op_kind: BinOp) -> Self { |
58 | match op_kind { | 58 | match op_kind { |
59 | BinOp::Assignment => FlipAction::DontFlip, | 59 | kind if kind.is_assignment() => FlipAction::DontFlip, |
60 | BinOp::AddAssign => FlipAction::DontFlip, | ||
61 | BinOp::DivAssign => FlipAction::DontFlip, | ||
62 | BinOp::MulAssign => FlipAction::DontFlip, | ||
63 | BinOp::RemAssign => FlipAction::DontFlip, | ||
64 | BinOp::ShrAssign => FlipAction::DontFlip, | ||
65 | BinOp::ShlAssign => FlipAction::DontFlip, | ||
66 | BinOp::SubAssign => FlipAction::DontFlip, | ||
67 | BinOp::BitOrAssign => FlipAction::DontFlip, | ||
68 | BinOp::BitAndAssign => FlipAction::DontFlip, | ||
69 | BinOp::BitXorAssign => FlipAction::DontFlip, | ||
70 | BinOp::GreaterTest => FlipAction::FlipAndReplaceOp("<"), | 60 | BinOp::GreaterTest => FlipAction::FlipAndReplaceOp("<"), |
71 | BinOp::GreaterEqualTest => FlipAction::FlipAndReplaceOp("<="), | 61 | BinOp::GreaterEqualTest => FlipAction::FlipAndReplaceOp("<="), |
72 | BinOp::LesserTest => FlipAction::FlipAndReplaceOp(">"), | 62 | BinOp::LesserTest => FlipAction::FlipAndReplaceOp(">"), |